This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Fix for compile time warning in binutils/nlmconv.c
- From: Ian Lance Taylor <ian at airs dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 15 Feb 2005 11:56:23 -0500
- Subject: Re: Fix for compile time warning in binutils/nlmconv.c
- References: <m3oeelansx.fsf@redhat.com>
Nick Clifton <nickc@redhat.com> writes:
> I am going to apply the patch below to fix a compile time warning
> when building nlmconv.c, although I am not sure if this is the
> proper way to fix the problem. The reason is that I am not sure why
> the parameterless prototype for localtime() is included at all.
> Presumably there are build environments out there where this
> function is not prototyped, or the header containing the prototype
> is not pulled in. To me this sounds like a configure problem, but
> for now I am keeping things simple.
The declaration is there because some systems did not declare
localtime, but an implicit declaration is undesirable because the
function does not return int. I agree that this is something which
can be fixed using an autoconf test.
However, your patch is not a good idea. There are undoubtedly systems
out there which declare localtime with different parameter types--in
particular omitting the const--so your patch will change those
systems from a warning to an error.
Better to remove the declaration entirely. Modern systems don't need
the declaration, and older systems will most likely be OK with the
warning.
Ian