public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock'
@ 2003-08-29  0:44 danglin at gcc dot gnu dot org
  2003-08-29  0:55 ` [Bug bootstrap/12100] " drow at mvista dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: danglin at gcc dot gnu dot org @ 2003-08-29  0:44 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/12100] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
  2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
@ 2003-08-29  0:55 ` drow at mvista dot com
  2003-08-29 13:20 ` [Bug bootstrap/12100] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: drow at mvista dot com @ 2003-08-29  0:55 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/12100] [3.4 Regression] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
  2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
  2003-08-29  0:55 ` [Bug bootstrap/12100] " drow at mvista dot com
@ 2003-08-29 13:20 ` pinskia at gcc dot gnu dot org
  2003-09-02 23:29 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-29 13:20 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |build
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-29 13:20:11
               date|                            |
            Summary|time.h:402: error: previous |[3.4 Regression] time.h:402:
                   |declaration of `clock'      |error: previous declaration
                   |evious declaration of       |of `clock'evious declaration
                   |`clock'                     |of `clock'
   Target Milestone|---                         |3.4


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-29 13:20 -------
Most likely an autoconf bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/12100] [3.4 Regression] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
  2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
  2003-08-29  0:55 ` [Bug bootstrap/12100] " drow at mvista dot com
  2003-08-29 13:20 ` [Bug bootstrap/12100] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-09-02 23:29 ` cvs-commit at gcc dot gnu dot org
  2003-11-01  0:04 ` neroden at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-02 23:29 UTC (permalink / raw)
  To: gcc-bugs

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 cvs-commit at gcc dot gnu dot org  2003-09-02 23:29 -------
Subject: Bug 12100

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dj@gcc.gnu.org	2003-09-02 23:29:10

Modified files:
	libiberty      : ChangeLog aclocal.m4 configure 

Log message:
	2003-08-29  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
	PR bootstrap/12100
	* aclocal.m4 (AC_LANG_FUNC_LINK_TRY): Define.
	* configure: Rebuilt.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/ChangeLog.diff?cvsroot=gcc&r1=1.455&r2=1.456
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/aclocal.m4.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/configure.diff?cvsroot=gcc&r1=1.71&r2=1.72


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/12100] [3.4 Regression] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
  2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-09-02 23:29 ` cvs-commit at gcc dot gnu dot org
@ 2003-11-01  0:04 ` neroden at gcc dot gnu dot org
  2003-11-01  0:56 ` drow at mvista dot com
  2003-11-01  0:58 ` danglin at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: neroden at gcc dot gnu dot org @ 2003-11-01  0:04 UTC (permalink / raw)
  To: gcc-bugs

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 neroden at gcc dot gnu dot org  2003-11-01 00:04 -------
Dave, you appear to have committed a patch which should have fixed this; did it
in fact fix it?  (If so, this bug can be closed, although pushing the fix upstream
is always nice.)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/12100] [3.4 Regression] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
  2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-11-01  0:04 ` neroden at gcc dot gnu dot org
@ 2003-11-01  0:56 ` drow at mvista dot com
  2003-11-01  0:58 ` danglin at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: drow at mvista dot com @ 2003-11-01  0:56 UTC (permalink / raw)
  To: gcc-bugs

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-11-01 00:56 -------
Subject: Re:  [3.4 Regression] time.h:402: error: previous declaration of `clock'evious declaration of `clock'

I believe that Dave's patch did fix it; also, autoconf 2.57a and later
include a fix.  2.57g was just released; I intend to test GCC with it
"sometime soon" (whatever that means).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/12100] [3.4 Regression] time.h:402: error: previous declaration of `clock'evious declaration of `clock'
  2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2003-11-01  0:56 ` drow at mvista dot com
@ 2003-11-01  0:58 ` danglin at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: danglin at gcc dot gnu dot org @ 2003-11-01  0:58 UTC (permalink / raw)
  To: gcc-bugs

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


danglin at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From danglin at gcc dot gnu dot org  2003-11-01 00:58 -------
I thought that I pushed this upstream but I'm not entirely sure.  The problem
occurred when the system that I normally use for email was down due to a power
supply failure.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-11-01  0:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29  0:44 [Bug bootstrap/12100] New: time.h:402: error: previous declaration of `clock'evious declaration of `clock' danglin at gcc dot gnu dot org
2003-08-29  0:55 ` [Bug bootstrap/12100] " drow at mvista dot com
2003-08-29 13:20 ` [Bug bootstrap/12100] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-09-02 23:29 ` cvs-commit at gcc dot gnu dot org
2003-11-01  0:04 ` neroden at gcc dot gnu dot org
2003-11-01  0:56 ` drow at mvista dot com
2003-11-01  0:58 ` danglin at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).