Bug#184762: libc6-dev exposes "long long" to non-GNU compilers
On Fri, 14 Mar 2003, Jeff Bailey wrote:
> On Fri, Mar 14, 2003 at 10:34:36AM -0500, Brad King wrote:
> > I use the "Comeau C++" compiler (www.comeaucomputing.com), which is a
> > non-GNU C++ compiler with strict ISO C++ conformance. It does not
> > support the "long long" type unless a special compiler flag is added.
> > The following lines show the problem I originally encountered:
>
> My copy of ISO/IEC 9899:1999 (ISO C) Section 6.2.5 [#4] defines long
> long. It would be inappropriate for it to be defined ISO C only.
>
> I'll need to check some other cases to see what the right fix is. I
> don't have my C++ books with me right now.
The current ISO C++ was released in 1998. Section 3.9.1 (fundamental
types) does not list "long long". While C99 supports the type, C++98 does
not. The following file is also provided by libc6-dev:
/usr/include/features.h
It contains these lines:
/* Decide whether a compiler supports the long long datatypes. */
#if defined __GNUC__ \
|| (defined __PGI && defined __i386__ ) \
|| (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
# define __GLIBC_HAVE_LONG_LONG 1
#endif
I think the proper fix is to put
#ifdef __GLIBC_HAVE_LONG_LONG
/* ... */
#endif
around the use of "long long".
-Brad
Reply to: