Fix for compile time warning in binutils/nlmconv.c

Ian Lance Taylor ian@airs.com
Tue Feb 15 18:33:00 GMT 2005


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



More information about the Binutils mailing list