This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/47802] [4.6 Regression] libgfortran/intrinsics/ctime.c:75:3: error: too few arguments to function 'ctime_r'
- From: "jb at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 4 Mar 2011 19:15:51 +0000
- Subject: [Bug libfortran/47802] [4.6 Regression] libgfortran/intrinsics/ctime.c:75:3: error: too few arguments to function 'ctime_r'
- Auto-submitted: auto-generated
- References: <bug-47802-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47802
--- Comment #34 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-03-04 19:15:34 UTC ---
(In reply to comment #30)
> On Fri, 25 Feb 2011, burnus at gcc dot gnu.org wrote:
>
> > Please shout loudly if there you still encounter a build failure!
> >
> >
> > TO BE DONE: The HP-UX (et al.?) compile warning regarding the _r functions and
> > _REENTRANT, cf. comment 20 and comment 23.
>
> In testing fix for above, I see:
>
> ../../../gcc/libgfortran/intrinsics/ctime.c: In function 'strctime':
> ../../../gcc/libgfortran/intrinsics/ctime.c:43:20: warning: initialization
> makes pointer from integer without a cast [enabled by default]
>
> Unfortunately, localtime_r has a different proto:
>
> int localtime_r(const time_t *timer, struct tm *result);
>
> Dave
Thanks to some __builtin tricks by Jakub, handling the different return types
should now work. However, one more possible issue: In
http://docs.hp.com/en/947/d8.html it says the old DCE threads prototype is
int localtime_r ( struct tm *result, time_t *clock );
which has the arguments the other way around than what you say above. For now,
the code assumes the order you provided; If this turns out to be wrong, we need
to do yet one more fix.. :(