bugGNUstep - Bugs: bug #18961, configure enables both...

Group
 
 

bug #18961: configure enables both HANDLE_LLONG_MAX and HANDLE_LONG_LONG_MAX, resulting in a build error in GSFormat.m on FBSD 6.2

Submitter:  Nikolaus Waxweiler <madleser>
Submitted:  Mon 05 Feb 2007 12:27:09 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 07 Feb 2007 05:12:55 PM UTC, comment #6: 

Um, this bug can be closed, since it was a stupid mistake on my side. That is, unless "./configure CC=gcc43" is supposed to spare the user from having to explicitly say "gmake CC=gcc43".

Nikolaus Waxweiler <madleser>
Mon 05 Feb 2007 02:08:18 PM UTC, comment #5: 

I found the error. GCC 4.3.0 brings its own limits.h which defines LONG_LONG_MAX. Says cpp43 on my system when I paste the test code from configure and add "LONG_LONG_MAX" and "LLONG_MAX":


#ifndef _GNU_SOURCE
        #define _GNU_SOURCE
        #endif
        #ifdef HAVE_STDINT_H
        #include <stdint.h>
        #endif
        #include <limits.h>
        #if defined(LONG_LONG_MAX)
        #if LONG_MAX == LONG_LONG_MAX
        #error long max equals long long max
        #endif
        #else
        #error long long max not defined
        #endif

LONG_LONG_MAX

LLONG_MAX
^D
[snip]

# 1 "/usr/include/sys/syslimits.h" 1 3 4
# 132 "/usr/include/limits.h" 2 3 4
# 123 "/usr/local/lib/gcc-4.3.0/gcc/i386-portbld-freebsd6.1/4.3.0/include/limits.h" 2 3 4
# 8 "/usr/local/lib/gcc-4.3.0/gcc/i386-portbld-freebsd6.1/4.3.0/include/syslimits.h" 2 3 4
# 12 "/usr/local/lib/gcc-4.3.0/gcc/i386-portbld-freebsd6.1/4.3.0/include/limits.h" 2 3 4
# 8 "<stdin>" 2
# 16 "<stdin>"
9223372036854775807LL

0x7fffffffffffffffLL


So they are both defined and both aliases for one and the same number. Now, "./configure CC=gcc43 CPP=cpp43" tests things under gcc43 conditions but doesn't actually set the compiler to gcc43 when gmaking, I have to explicitly say "gmake CC=gcc43". Duh! I should have noticed this earlier.

Nikolaus Waxweiler <madleser>
Mon 05 Feb 2007 01:33:19 PM UTC, comment #4: 

I guess the thing to do then would be to look at the configure log file and see how a compiler bug (if that's the problem) could have caused the configure script to define HANDLE_LONG_LONG_MAX without LONG_LONG_MAX being defined.

Richard Frith-Macdonald <CaS>
Group Member
Mon 05 Feb 2007 01:13:00 PM UTC, comment #3: 


> You say that only LLONG_MAX is defined, in which case line 113 should evaluate to true, but you say it evaluates to false.

It evaluates to false because "configure enables both HANDLE_LLONG_MAX and HANDLE_LONG_LONG_MAX" while only LLONG_MAX is actually defined, with gcc 4.3.0 ("./configure CC=gcc43") at least. It works just fine with 3.4.6 ("./configure"). Could be some wierd cpp43 preprocessor bug.

Nikolaus Waxweiler <madleser>
Mon 05 Feb 2007 12:59:34 PM UTC, comment #2: 

I don't quite understand this report.

You say that only LLONG_MAX is defined, in which case line 113 should evaluate to true, but you say it evaluates to false.
Did you mean to say that on FreeBSD 6.2 both LLONG_MAX and LONG_LONG_MAX are defined?

If so, why does line 123 evaluate to true?  the !defined(LONG_LONG_MAX) should evaluate to false.

if not, why does line 123 evaluate to true? the defined(HANDLE_LONG_LONG_MAX) should evaluate to false.

Could something have changed on your system between configuring and compiling, such that the HANDLE_... value set by the configure script don't match the preprocessor constants set in limits.h?

Or could it be that your system supports both forms but switches between them depending on what headers are includes and what preprocessor constants are defined before the headers?

Richard Frith-Macdonald <CaS>
Group Member
Mon 05 Feb 2007 12:42:34 PM UTC, comment #1: 

Argh! Ok, scratch that, it works with gcc 3.4.6 but not with 4.3.0. Meh. Gotta test things more thoroughly.

Nikolaus Waxweiler <madleser>
Mon 05 Feb 2007 12:27:09 PM UTC, original submission:  

On FreeBSD 6.2, only LLONG_MAX is defined. GSFormat.m (lines 112-129) wants both HANDLE_* defines to be mutually exclusive:

> line 113: #if defined(HANDLE_LLONG_MAX) && !defined(HANDLE_LONG_LONG_MAX)

evaluates to false and so doesn't #define LONG_LONG_MAX LLONG_MAX

> line 123: #if     defined(HANDLE_LONG_LONG_MAX) && !defined(LONG_LONG_MAX)

then evaluates to true and errors out.

Using revision 24472.

Nikolaus Waxweiler <madleser>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by madleser (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-09 CaS StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code