Re: uint64_t fails with C++

2011-12-07 Thread Paul Eggert
Thanks for the details. I pushed this patch into autoconf: AC_LANG_BOOL_COMPILE_TRY(C): port to g++ with warnings * lib/autoconf/c.m4 (AC_LANG_BOOL_COMPILE_TRY(C)): Use the array as well as setting it, to pacify g++. Reported by Werner Lemberg in

[PATCH] inttypes, stdint: add C++11 support

2011-12-07 Thread Paul Eggert
This proposed gnulib patch follows up on a thread in the autoconf mailing list rooted at . This text below was computed with "diff -w" to avoid spurious whitespace changes; the full (compressed) patch is attached. diff --git a/Chang

Re: uint64_t fails with C++

2011-12-07 Thread Paul Eggert
On 12/07/11 14:20, Nick Bowler wrote: > a program does *not* need to define __STDC_LIMIT_MACROS prior > to including Ah, then gnulib needs to be updated to match C++11. I'll propose a patch for that, in a different thread. ___ Autoconf mailing list Aut

Re: uint64_t fails with C++

2011-12-07 Thread Bob Friesenhahn
On Wed, 7 Dec 2011, Nick Bowler wrote: Clearly, depending on an implementation-dependent macro is not suitable for portable software. i thought __STDC_LIMIT_MACROS was part of the spec and thus not "implementation dependent" ? Sort-of. It is included non-normatively in the C specification a

Re: uint64_t fails with C++

2011-12-07 Thread Nick Bowler
On 2011-12-07 16:58 -0500, Mike Frysinger wrote: > On Wednesday 07 December 2011 16:18:26 Nick Bowler wrote: > > On 2011-12-07 15:31 -0500, Mike Frysinger wrote: > > > i thought __STDC_LIMIT_MACROS was part of the spec and thus not > > > "implementation dependent" ? > > > > Sort-of. It is include

Re: uint64_t fails with C++

2011-12-07 Thread Ben Pfaff
Mike Frysinger writes: > On Wednesday 07 December 2011 14:10:27 Bob Friesenhahn wrote: >> On Wed, 7 Dec 2011, Werner LEMBERG wrote: >> >> C++ compilers do not get these definition from stdint.h unless >> >> __STDC_LIMIT_MACROS is defined, the macros are in C99 and later, but >> >> were not in the

Re: uint64_t fails with C++

2011-12-07 Thread Nick Bowler
On 2011-12-07 15:31 -0500, Mike Frysinger wrote: > On Wednesday 07 December 2011 14:10:27 Bob Friesenhahn wrote: > > On Wed, 7 Dec 2011, Werner LEMBERG wrote: > > >> C++ compilers do not get these definition from stdint.h unless > > >> __STDC_LIMIT_MACROS is defined, the macros are in C99 and later

Re: uint64_t fails with C++

2011-12-07 Thread Mike Frysinger
On Wednesday 07 December 2011 16:18:26 Nick Bowler wrote: > On 2011-12-07 15:31 -0500, Mike Frysinger wrote: > > On Wednesday 07 December 2011 14:10:27 Bob Friesenhahn wrote: > > > On Wed, 7 Dec 2011, Werner LEMBERG wrote: > > > >> C++ compilers do not get these definition from stdint.h unless > >

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
>> Thanks. However, this still doesn't explain why autoconf (using g++!) >> says that uint64_t exists: __STDC_LIMIT_MACROS is not used in any part >> of autoconf. > > I think that has been covered... Nope. A search for __STDC_LIMIT_MACROS within the git repository gives no results. >> PS: If u

Re: uint64_t fails with C++

2011-12-07 Thread Eric Blake
On 12/07/2011 11:08 AM, Werner LEMBERG wrote: > >>>#if defined UINT64_MAX || defined uint64_t >>>typedef uint64_t TA_ULongLong; >>>#else >>># error "No unsigned 64bit wide data type found." >>>#endif >> >> stdint.h will not define UINT64_MAX if __cplusplus is defined unless >>

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
> If you do need the UINT64_MAX etc macros as well as the uint64_t > type then you will have to define __STDC_LIMIT_MACROS. Yep. I believe this is something I would have never found out without assistance. Thanks again to all of you! Werner ___

Re: uint64_t fails with C++

2011-12-07 Thread Peter O'Gorman
On 12/07/2011 01:04 PM, Werner LEMBERG wrote: It's nothing to do with autoconf really, configure correctly finds uint64_t, your C program then checks for UINT64_MAX or a uint64_t macro instead of #include and checking for HAVE_UINT64_T. HAVE_UINT64_T is *not* defined in my... Sorry, my bad

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
> If the above guesswork holds, It doesn't :-) > then I wonder why your project uses C++ file extensions and $CC > (your said it was a C file). It should be either C file extensions > and $CC, or C++ file extensions and $CXX. Or? As Nelson Beebe has explained to me some time ago, there are a bu

Re: uint64_t fails with C++

2011-12-07 Thread Peter Rosin
Werner LEMBERG skrev 2011-12-07 21:08: >>> I still don't understand the details of the autoconf problem (and I >>> still think that something is fishy), but defining this macro works >>> just fine :-) >> >> Clearly, depending on an implementation-dependent macro is not >> suitable for portable soft

Re: uint64_t fails with C++

2011-12-07 Thread Mike Frysinger
On Wednesday 07 December 2011 14:10:27 Bob Friesenhahn wrote: > On Wed, 7 Dec 2011, Werner LEMBERG wrote: > >> C++ compilers do not get these definition from stdint.h unless > >> __STDC_LIMIT_MACROS is defined, the macros are in C99 and later, but > >> were not in the C++ standard of the day (I don

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
>> I still don't understand the details of the autoconf problem (and I >> still think that something is fishy), but defining this macro works >> just fine :-) > > Clearly, depending on an implementation-dependent macro is not > suitable for portable software. So please tell me how to solve this p

Re: uint64_t fails with C++

2011-12-07 Thread Bob Friesenhahn
On Wed, 7 Dec 2011, Werner LEMBERG wrote: C++ compilers do not get these definition from stdint.h unless __STDC_LIMIT_MACROS is defined, the macros are in C99 and later, but were not in the C++ standard of the day (I don't know if they're in later C++ standards), so aren't defined for C++ compi

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
> It's nothing to do with autoconf really, configure correctly finds > uint64_t, your C program then checks for UINT64_MAX or a uint64_t > macro instead of #include and checking for HAVE_UINT64_T. HAVE_UINT64_T is *not* defined in my ... > C++ compilers do not get these definition from stdint.h

Re: uint64_t fails with C++

2011-12-07 Thread Peter O'Gorman
On 12/07/2011 12:08 PM, Werner LEMBERG wrote: #if defined UINT64_MAX || defined uint64_t typedef uint64_t TA_ULongLong; #else # error "No unsigned 64bit wide data type found." #endif stdint.h will not define UINT64_MAX if __cplusplus is defined unless __STDC_LIMIT_MACROS

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
>>#if defined UINT64_MAX || defined uint64_t >>typedef uint64_t TA_ULongLong; >>#else >># error "No unsigned 64bit wide data type found." >>#endif > > stdint.h will not define UINT64_MAX if __cplusplus is defined unless > __STDC_LIMIT_MACROS is defined before you include it.

Re: uint64_t fails with C++

2011-12-07 Thread Peter O'Gorman
On 12/07/2011 03:17 AM, Werner LEMBERG wrote: #if defined UINT64_MAX || defined uint64_t typedef uint64_t TA_ULongLong; #else # error "No unsigned 64bit wide data type found." #endif stdint.h will not define UINT64_MAX if __cplusplus is defined unless __STDC_LIMIT_MACROS is de

Re: uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
>> My main question is: Why does the autoconf test succeeds (which >> properly uses g++ for its test according to the config.log file) >> but the compilation in my test file fails? A bug? A feature? > > Sorry, I'm not sure about that bit. Does config.log show it using > any special compiler opt

uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
In my configure.ac file I have AC_PROG_CC AC_PROG_CPP AC_TYPE_UINT64_T In my C file I have #include #if HAVE_STDINT_H # include #endif #if defined UINT64_MAX || defined uint64_t typedef uint64_t TA_ULongLong; #else # error "No unsigned 64bit wide data type found."

uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
[In case you receive this mulitple times, sorry for that.] In my configure.ac file I have AC_PROG_CC AC_PROG_CPP AC_TYPE_UINT64_T In my C file I have #include #if HAVE_STDINT_H # include #endif #if defined UINT64_MAX || defined uint64_t typedef uint64_t TA_ULongLong;

uint64_t fails with C++

2011-12-07 Thread Werner LEMBERG
In my configure.ac file I have AC_PROG_CC AC_PROG_CPP AC_TYPE_UINT64_T In my C file I have #include #if HAVE_STDINT_H # include #endif #if defined UINT64_MAX || defined uint64_t typedef uint64_t TA_ULongLong; #else # error "No unsigned 64bit wide data type found."

Re: Qt4 autoconf macros

2011-12-07 Thread Frederik Heber
On 12/04/2011 11:51 AM, Lorenzo Bettini wrote: > On 11/17/2010 04:08 PM, Alberto Luaces wrote: >> santilistas writes: >> >>> Frederik Heber1 escribió: Hey there, one look into autoconf archives at http://ac-archive.sourceforge.net/ac-archive/ revealed: bnv_have_qt ... which