This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for compile time warning in binutils/nlmconv.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]