[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Re: xgetdomainname.c should include stdlib.h

From: Jim Meyering
Subject: [Bug-gnulib] Re: xgetdomainname.c should include stdlib.h
Date: Sun, 18 Apr 2004 23:43:44 +0200

Simon Josefsson <address@hidden> wrote:
>> I agree that including stdlib.h is better.
> in xgetdomainname.c or xalloc.h?

in xgetdomainname.c, as your patch suggested.

>> BTW, wouldn't it be better without the `Get ...' comments?
>> The `Get errno.' one certainly doesn't add anything useful.
> Yes, perhaps.  The cases where I find those comments useful are when
> checking if the header file is still required -- searching for the
> function/variable name mentioned in the comment answer that quickly.

The problem is that such comments can easily get out of date,
e.g., when the code changes to depend on yet another function
from the affected header file.
If there were some way to automatically guarantee
consistency, it might be worthwhile.  Hm... but if we had
that, then we wouldn't need the comments in the first place.

This is also relevant to your getdate.h suggestion.
For that same reason (risk of divergence), I prefer to keep
most function describing comments in only one place: just above
the actual function definition.  Some people prefer to put that
documentation in the .h file.  In any case, it should appear in
just one place unless you can ensure that the multiple copies
will always remain identical.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]