GNU bug report logs - #11781
compilation failure: `ULLONG_MAX' undeclared

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> gnu.org>

Date: Mon, 25 Jun 2012 18:17:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11781 in the body.
You can then email your comments to 11781 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11781; Package emacs. (Mon, 25 Jun 2012 18:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dan Nicolaescu <dann <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Jun 2012 18:17:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: compilation failure:  `ULLONG_MAX' undeclared
Date: Mon, 25 Jun 2012 14:12:23 -0400
On an ancient machine (don't ask) building the trunk fails:

gcc -c  -Demacs -DHAVE_CONFIG_H  -I. -I/tmp/emacs/src -I../lib -I/tmp/emacs/src/../lib   -I/usr/X11R6/include            -MMD -MF deps/sysdep.d -MP     -g -O2 /tmp/emacs/src/sysdep.c
/tmp/emacs/src/sysdep.c: In function `time_from_jiffies':
/tmp/emacs/src/sysdep.c:2587: `ULLONG_MAX' undeclared (first use in this function)
/tmp/emacs/src/sysdep.c:2587: (Each undeclared identifier is reported only once
/tmp/emacs/src/sysdep.c:2587: for each function it appears in.)
make[1]: *** [sysdep.o] Error 1


$ cat /etc/redhat-release 
Red Hat Linux release 7.3 (Valhalla)

$ rpm -q glibc-devel
glibc-devel-2.2.5-44

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11781; Package emacs. (Tue, 26 Jun 2012 13:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 11781 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: 11781 <at> debbugs.gnu.org
Subject: Re: bug#11781: compilation failure:  `ULLONG_MAX' undeclared
Date: Tue, 26 Jun 2012 09:10:21 -0400
Dan Nicolaescu <dann <at> gnu.org> writes:

> On an ancient machine (don't ask) building the trunk fails:
>
> gcc -c  -Demacs -DHAVE_CONFIG_H  -I. -I/tmp/emacs/src -I../lib -I/tmp/emacs/src/../lib   -I/usr/X11R6/include            -MMD -MF deps/sysdep.d -MP     -g -O2 /tmp/emacs/src/sysdep.c
> /tmp/emacs/src/sysdep.c: In function `time_from_jiffies':
> /tmp/emacs/src/sysdep.c:2587: `ULLONG_MAX' undeclared (first use in this function)
> /tmp/emacs/src/sysdep.c:2587: (Each undeclared identifier is reported only once
> /tmp/emacs/src/sysdep.c:2587: for each function it appears in.)
> make[1]: *** [sysdep.o] Error 1
>
>
> $ cat /etc/redhat-release 
> Red Hat Linux release 7.3 (Valhalla)
>
> $ rpm -q glibc-devel
> glibc-devel-2.2.5-44
>
> $ gcc -v
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
> gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)

The compilation succeeds when using "gcc -std=c99" or "gcc -std=gnu99"

Looking at config.log, it tries to use -std=gnu99 but the test fails:

configure:6807: gcc -std=gnu99 -c -g -O2  conftest.c >&5
conftest.c:68: array size missing in `data'
conftest.c: In function `test_restrict':
conftest.c:85: parse error before `unsigned'
conftest.c:85: `i' undeclared (first use in this function)
conftest.c:85: (Each undeclared identifier is reported only once
conftest.c:85: for each function it appears in.)
conftest.c:85: parse error before `)'
conftest.c: In function `test_varargs':
conftest.c:96: parse error before `args_copy'
conftest.c:97: `args_copy' undeclared (first use in this function)
conftest.c:99: parse error before `const'
conftest.c:108: `str' undeclared (first use in this function)
conftest.c:111: `number' undeclared (first use in this function)
conftest.c:114: `fnumber' undeclared (first use in this function)
conftest.c: In function `main':
conftest.c:134: parse error before `char'
conftest.c:141: parse error before `struct'
conftest.c:143: `ia' undeclared (first use in this function)
conftest.c:144: parse error before `int'
conftest.c:144: `i' undeclared (first use in this function)
conftest.c:144: parse error before `)'
conftest.c:154: `ni' undeclared (first use in this function)
conftest.c:156: parse error before `int'
conftest.c:157: `dynamic_array' undeclared (first use in this function)
conftest.c:160: `newvar' undeclared (first use in this function)
configure:6807: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "emacs"
| #define PACKAGE_TARNAME "emacs"
| #define PACKAGE_VERSION "24.1.50"
| #define PACKAGE_STRING "emacs 24.1.50"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "emacs"
| #define VERSION "24.1.50"
| #define MAIL_USE_POP 1
| #define SYNC_INPUT 1
| #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_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _DARWIN_C_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define _FILE_OFFSET_BITS 64
| /* end confdefs.h.  */
| #include <stdarg.h>
| #include <stdbool.h>
| #include <stdlib.h>
| #include <wchar.h>
| #include <stdio.h>
| 
| // Check varargs macros.  These examples are taken from C99 6.10.3.5.
| #define debug(...) fprintf (stderr, __VA_ARGS__)
| #define showlist(...) puts (#__VA_ARGS__)
| #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
| static void
| test_varargs_macros (void)
| {
|   int x = 1234;
|   int y = 5678;
|   debug ("Flag");
|   debug ("X = %d\n", x);
|   showlist (The first, second, and third items.);
|   report (x>y, "x is %d but y is %d", x, y);
| }
| 
| // Check long long types.
| #define BIG64 18446744073709551615ull
| #define BIG32 4294967295ul
| #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
| #if !BIG_OK
|   your preprocessor is broken;
| #endif
| #if BIG_OK
| #else
|   your preprocessor is broken;
| #endif
| static long long int bignum = -9223372036854775807LL;
| static unsigned long long int ubignum = BIG64;
| 
| struct incomplete_array
| {
|   int datasize;
|   double data[];
| };
| 
| struct named_init {
|   int number;
|   const wchar_t *name;
|   double average;
| };
| 
| typedef const char *ccp;
| 
| static inline int
| test_restrict (ccp restrict text)
| {
|   // See if C++-style comments work.
|   // Iterate through items via the restricted pointer.
|   // Also check for declarations in for loops.
|   for (unsigned int i = 0; *(text+i) != '\0'; ++i)
|     continue;
|   return 0;
| }
| 
[snip]

Any idea what is going on here?





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 07 Jul 2012 03:18:02 GMT) Full text and rfc822 format available.

Notification sent to Dan Nicolaescu <dann <at> gnu.org>:
bug acknowledged by developer. (Sat, 07 Jul 2012 03:18:02 GMT) Full text and rfc822 format available.

Message #13 received at 11781-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 11781-done <at> debbugs.gnu.org
Subject: Re: bug#11781: compilation failure:  `ULLONG_MAX' undeclared
Date: Fri, 06 Jul 2012 20:12:07 -0700
In trunk bzr 108930 I patched sysdep.c so that it defines
ULLONG_MAX if the system doesn't already define it; that should
fix the immediate problem so I've marked this as done.

About the C99 issue: Emacs uses a standard test for
C99, which checks for many C99 features that your
compiler lacks.  It then falls back on ordinary gcc.
Perhaps this could be hacked to be smarter, though I'm
not sure it's worth the aggravation if things are
working for you now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Aug 2012 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.