Re: The importance of prototypes



Thanks for the help guys,

Browsing around in gnu.gcc.bug I see that in gcc if no prototype is
given, the function passes all arguments as ints (no matter the local
data type or the function declarations desired data type). I am
wondering if this is the way the C standard designated it, or if gcc is
taking a liberty here.

This seems silly as this is just memory which I would expect would be
directly copied to the stack if no prototype is given to say otherwise,
not casted behind the scenes.

Zach

.



Relevant Pages

  • Re: Gforth and gcc "progress"
    ... on the Alpha and "fixed" it by changing the documentation, ... sense to have one data type which is twice as long as the longest "native" ... The first GCC port to 64 bit was before, ...
    (comp.lang.forth)
  • Re: The importance of prototypes
    ... >data type or the function declarations desired data type). ... In the absence of a prototype, the default promotions are used. ... Roughly, integer types smaller than int are promoted to int, ...
    (comp.lang.c)
  • Re: GCC-Bug ? (Unintended "overloading")
    ... (compiler/OS) ... int readis not a prototype; ... Then either there's something you're not telling us, or gcc is broken. ... compiler" is an oft-cried cry, but the better you get at C, the less often ...
    (comp.lang.c)
  • Re: [PATCH] IA64 build broken... cond_syscall()... Fixes?
    ... > which of course doesn't work if there's a prototype in scope for x, ... However, we don't want to do this for IA64, to allow ... > compilers other than gcc to be used (in general, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: IS this a proper way of freeing memory with free()
    ... prototype here. ... I am *not* saying any compiler must emit warning about missing ... I am saying gcc does it when you use -W -Wall. ...
    (comp.lang.c)