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 23:44, Dennis Clarke wrote:
> On 07/18/2017 06:33 PM, Jonathan Wakely wrote:
>>
>> 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() { }
>>
>
> Not interested in "-Wunused-parameter" issues. I think you missed the
> point.

No, I didn't, that's why I started my reply with "Aside:" -- did you miss that?

I wasn't responding about the unterminated line, just wondering why
you (and so many people reporting bugs) bother to define parameters
that aren't used or needed.



[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