octave-maintainers
[Top][All Lists]
Advanced

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

Re: gnulib warnings during compilation


From: Mike Miller
Subject: Re: gnulib warnings during compilation
Date: Mon, 1 Dec 2014 15:57:52 -0500

On Mon, Dec 1, 2014 at 12:38:33 -0800, Rik wrote:
> 12/1/14
>
> I'm getting 3 warnings when I compile with -O0, which I do not get when I
> compile with -O2.  They are:
>
> --- Warning List ---
> system/oct-time.cc:238:38: warning: call to 'localtime' declared with
> attribute warning: The symbol ::localtime refers to the system function.
> Use gnulib::localtime instead. [enabled by default]
> system/oct-time.cc:248:35: warning: call to 'gmtime' declared with
> attribute warning: The symbol ::gmtime refers to the system function. Use
> gnulib::gmtime instead. [enabled by default]
> corefcn/load-save.cc:1204:28: warning: call to 'gmtime' declared with
> attribute warning: The symbol ::gmtime refers to the system function. Use
> gnulib::gmtime instead. [enabled by default]
> --- End Warning List ---
>
> It is true that the code isn't decorated with the gnulib:: prefix so this
> is calling the system function.  Is that alright?  Currently configure does
> not check that these functions are available using AC_CHECK_FUNC so I
> suppose it is possible that someone has a libc which doesn't implement
> them.  One approach is to do nothing.  A second would be to add
> AC_CHECK_FUNC calls for the gmtime and localtime functions.  A third would
> be to add gmtime and localtime to the gnulib bootstrap.conf file and then
> decorate these three instances with gnulib::.  Does anyone like one of
> these solutions more than another?

If the warning is showing up, it means we are already pulling in the
relevant gnulib module. Indeed, the module named "time" covers all of
the standard library declared in time.h. So no changes to
bootstrap.conf needed.

Since we are using much of gnulib already, I'd say we might as well
use the namespaced gnulib::gmtime and gnulib::localtime, and let
gnulib provide a replacement if/when needed.

-- 
mike



reply via email to

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