This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Remove ctime declaration in libgcc2.c
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: grahams at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu, schwab at suse dot de
- Date: Tue, 11 Dec 2001 14:28:25 -0500 (EST)
- Subject: Re: Remove ctime declaration in libgcc2.c
> Richard Kenner wrote:
> >
> > This will break ia64. You cannot have a function returning a
> > pointer without a declaration. We either must include <time.h>
> > or declare ctime manually. No other way will work, you'll get
> > an instant crash.
> >
> > I'm open to suggestions. Nobody had any way to do either of those
> > the last time it was discussed.
>
> If I understand the problem we can't provide a prototype for ctime
> because it may conflict with the standard prototype for ctime and
> without a prototype ia64 is broken.
>
> The only way I can see to get this to work is to cast all the uses of
> ctime
>
> ((void * (*)(void *))ctime) (&time_value);
>
> which could all be wrapped up in a macro to hide it's ugliness.
I don't think this will work unless ctime is already declared,
otherwise you'll just get a undeclared identifier error.
But if ctime was already declared, you wouldn't have the problem in
the first place.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions