Patch: remove nntp protocol constants from include/nntp.h in inn-CURRENT-20061121
Bill Davidsen
davidsen at tmr.com
Thu Dec 14 19:06:03 UTC 2006
Russ Allbery wrote:
> Adam J Richter <adam at yggdrasil.com> writes:
>
>
>> Currently, include/nntp.h and include/inn/nntp.h each define
>> a different set of symbol names for numeric NNTP response codes. The
>> following switches everything to use the codes from include/inn/nntp.h,
>> replacing the definitions in include/nntp.h with a #include "inn/nntp.h".
>>
>
> I have *finally* had a chance to review this and apply it. Thank you very
> much for your work! I'm sorry that it took me so long to apply. I'm
> still catching up on various life stuff and other committments, but I'm
> getting closer to having time to spend on INN.
>
>
>> If I compile without "-O2 -g", I get exactly the same .o files
>> with and without this patch applied. I have also verified that it builds
>> with "./configure --prefix=/usr && make all && make install".
>>
>
> Thank you for this degree of verification!
>
>
>> By the way, compiling with "-O2 generated different .o files
>> under "-g -O2", even after stripping them, in the case of about six of
>> the .o files in the tree. From running diff on the generated
>> x86 assembler code in for backends/nntpget.c, it appears that gcc -O2
>> had moved some variable initializion that originally looked like this:
>>
>
>
>> foo = 0;
>> bar = 0;
>> baz = 0;
>> if (func() == 0)
>> exit(1);
>>
>
>
>> ...to...
>>
>
>
>> if (func() == 0)
>> exit(1);
>> foo = 0;
>> bar = 0;
>> baz = 0;
>>
>
>
>> ...presumably because it told that exit does not return.
>>
>
> Huh, interesting. Surprising. Some sort of weird artifact in the
> optimizer, I suppose. gcc does do different things depending on whether
> debugging is enabled, occasionally, even though ideally it shouldn't.
>
>
Clearly this is better code, not to perform operations on a variable
which is not going to be used. I'm more surprised that gcc knew about
exit() than that it did the smart thing with the information.
--
bill davidsen <davidsen at tmr.com>
CTO TMR Associates, Inc
Doing interesting things with small computers since 1979
More information about the inn-workers
mailing list