This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/12100] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
- From: "drow at mvista dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2003 00:55:48 -0000
- Subject: [Bug bootstrap/12100] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
- References: <20030829004420.12100.danglin@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12100
------- Additional Comments From drow at mvista dot com 2003-08-29 00:55 -------
Subject: Re: New: time.h:402: error: previous declaration of `clock'evious declaration of `clock'
On Fri, Aug 29, 2003 at 12:44:25AM -0000, danglin at gcc dot gnu dot org wrote:
> | /* System header to define __stub macros and hopefully few prototypes,
> | which can conflict with char clock (); below.
> | Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
> | <limits.h> exists even on freestanding compilers. */
> | #ifdef __STDC__
> | # include <limits.h>
> | #else
> | # include <assert.h>
> | #endif
> sys/time.h is included by limits.h when _HPUX_SOURCE is defined.
Blast. I guess this is a bug in autoconf; you may wish to report it to
the autoconf developers.
In the meantime, it should be possible to avoid this by writing our own
test for clock (and any other affected functions) which does not
include <limits.h> if _HPUX_SOURCE is defined. It looks like that's
only for the __stub macros, which are a glibcism anyway. Or you could
copy/paste the definition of AC_LANG_FUNC_LINK_TRY(C) from c.m4 into
libiberty/aclocal.m4 and fix it there. I just verified that that will
generate appropriate checks.