Subject: Re: CVS commit: src/usr.bin/whois
To: Bill Studenmund <wrstuden@netbsd.org>
From: Lennart Augustsson <lennart@augustsson.net>
List: source-changes
Date: 10/16/2003 23:03:43
Sorry, I take that back. It does nor produce the same code. One
instruction has moved.
-- Lennart
Bill Studenmund wrote:
> On Thu, Oct 16, 2003 at 07:52:42PM +0200, Lennart Augustsson wrote:
>
>>Yes, indeed. GCC even produces identical code before and after the
>>"fix". Why are these pointless changes done?
>
>
> Uhm, while I agree that many changes for change's sake are bad, this
> change seems reasonable to me. At least in principle (if on error we exit
> the program, maybe not).
>
> Whenever you realloc(), I've always found it safest to realloc to a temp
> variable, then if there's an error, you still have the original pointer.
>
> Note that server is declared static, so it will stick around, no? Thus if
> GCC is producing the same code, it's doing something wrong. Either it's
> storing when it shouldn't now, or before it wasn't storing when it should.
>
> Take care,
>
> Bill