This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: preprocessing directive with no new-line character


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]