This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock'
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2003 00:44:25 -0000
- Subject: [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock'
- 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
Summary: time.h:402: error: previous declaration of `clock'
evious declaration of `clock'
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: bootstrap
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: danglin at gcc dot gnu dot org
CC: drow at mvista dot com,gcc-bugs at gcc dot gnu dot org
GCC build triplet: hppa2.0w-hp-hpux11.11
GCC host triplet: hppa2.0w-hp-hpux11.11
GCC target triplet: hppa2.0w-hp-hpux11.11
The following bootstrap error occurs building libiberty:
if [ x"-fPIC" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc/libiberty/../include -W -Wall -
Wtraditional -pedantic -fPIC ../../gcc/libiberty/clock.c -o pic/clock.o; \
else true; fi
../../gcc/libiberty/clock.c:71: error: conflicting types for `clock'
/opt/gnu/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3/include/sys/time.h:402: error: pr
evious declaration of `clock'
We didn't used to compile clock.o under hpux. We are knwo trying to build it
because the configure test fails:
configure:4628: checking for clock
configure:4683: gcc -o conftest -g -O2 conftest.c >&5
configure:4701: error: conflicting types for `clock'
/opt/gnu/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3/include/sys/time.h:402: error:
previous declaration of `clock'
configure:4686: $? = 1
configure: failed program was:
| #line 4638 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define WORDS_BIGENDIAN 1
| #define HOST_WORDS_BIG_ENDIAN 1
| #define BYTEORDER 4321
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_STRING_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_TIME_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_SYS_PSTAT_H 1
| #define HAVE_SYS_SYSINFO_H 1
| #define HAVE_SYS_WAIT_H 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_UINTPTR_T 1
| #define HAVE_ATEXIT 1
| #define HAVE_BASENAME 1
| #define HAVE_BCMP 1
| #define HAVE_BCOPY 1
| #define HAVE_BSEARCH 1
| #define HAVE_BZERO 1
| #define HAVE_CALLOC 1
| /* end confdefs.h. */
| /* 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
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char clock ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_clock) || defined (__stub___clock)
| choke me
| #else
| char (*f) () = clock;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != clock;
| ;
| return 0;
| }
sys/time.h is included by limits.h when _HPUX_SOURCE is defined.
I believe that this problem was introduced by the following change:
2003-08-27 Daniel Jacobowitz <drow@mvista.com>
* aclocal.m4: Include acx.m4 and no-executables.m4.
(libiberty_AC_FUNC_STRNCMP): Use AC_LIBOBJ.
(LIB_AC_PROG_CC): Remove.
* configure.in: Update AC_PREREQ to 2.57. Use GCC_NO_EXECUTABLES.
Use AC_PROG_CC and set ac_libiberty_warn_cflags instead of using
LIB_AC_PROG_CC. Use AC_LIBOBJ. Call AC_ISC_POSIX later, only if
performing link tests.
* configure: Regenerated.