You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@apache.org> on 2018/03/16 09:14:42 UTC
Re: svn commit: r1826928 -
/subversion/trunk/subversion/libsvn_client/shelf.c
On 16.03.2018 10:05, danielsh@apache.org wrote:
> Author: danielsh
> Date: Fri Mar 16 09:05:45 2018
> New Revision: 1826928
>
> URL: http://svn.apache.org/viewvc?rev=1826928&view=rev
> Log:
> * subversion/libsvn_client/shelf.c: Add newline at end of file.
> I would have added -Wno-newline-eof to configure's auto flags, but
> technically having no final newline is undefined behaviour.
Uh, no it's not? C doesn't care about newlines at EOF.
It's bad writing style, but does not affect the meaning of the program.
-- Brane
Re: svn commit: r1826928 -
/subversion/trunk/subversion/libsvn_client/shelf.c
Posted by Branko Čibej <br...@apache.org>.
On 16.03.2018 10:22, Daniel Shahaf wrote:
> Branko Čibej wrote on Fri, 16 Mar 2018 10:14 +0100:
>> On 16.03.2018 10:05, danielsh@apache.org wrote:
>>> Author: danielsh
>>> Date: Fri Mar 16 09:05:45 2018
>>> New Revision: 1826928
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1826928&view=rev
>>> Log:
>>> * subversion/libsvn_client/shelf.c: Add newline at end of file.
>>> I would have added -Wno-newline-eof to configure's auto flags, but
>>> technically having no final newline is undefined behaviour.
>>
>> Uh, no it's not? C doesn't care about newlines at EOF.
>>
>> It's bad writing style, but does not affect the meaning of the program.
> According to http://port70.net/~nsz/c/c89/c89-draft.html#A.6.2 (first
> bullet), it is UB for a file not to end with a newline. That's a draft, but
> I think it agrees with the final standard on this point (and if it doesn't,
> I'd be happy to add -Wno-newline-eof to our build flags instead).
It appears that you're right (for C90 and C99 and C++98, but not for
C++11 and later).
Shows that in the good old days, standards authors had a feeling for
good writing style, too. :)
-- Brane
Re: svn commit: r1826928 -
/subversion/trunk/subversion/libsvn_client/shelf.c
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Branko Čibej wrote on Fri, 16 Mar 2018 10:14 +0100:
> On 16.03.2018 10:05, danielsh@apache.org wrote:
> > Author: danielsh
> > Date: Fri Mar 16 09:05:45 2018
> > New Revision: 1826928
> >
> > URL: http://svn.apache.org/viewvc?rev=1826928&view=rev
> > Log:
> > * subversion/libsvn_client/shelf.c: Add newline at end of file.
> > I would have added -Wno-newline-eof to configure's auto flags, but
> > technically having no final newline is undefined behaviour.
>
>
> Uh, no it's not? C doesn't care about newlines at EOF.
>
> It's bad writing style, but does not affect the meaning of the program.
According to http://port70.net/~nsz/c/c89/c89-draft.html#A.6.2 (first
bullet), it is UB for a file not to end with a newline. That's a draft, but
I think it agrees with the final standard on this point (and if it doesn't,
I'd be happy to add -Wno-newline-eof to our build flags instead).
Cheers,
Daniel