Re: preprocessing directive with no new-line character

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18 July 2017 at 21:46, Dennis Clarke wrote:
> Fascinating. I never would have thought that a zero line length file
> would be accepted as valid. However gcc ( older rev 4.9.2 ) will
> accept this :
>
> $ printf "int main ( int argc, char* argv[] ) { return 0; }" > tzero.c

Aside: why would you bother to declare parameters for such a program?
What's wrong with int main(void) ?

I wonder about this every time somebody reports a bug that gives
-Wunused-parameter warnings because of pointless unused parameters.

Since C99 (and in C++) you don't even need the return statement.

int main() { }



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux