This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++ veresion 3.3.2 on HP-UX IA 11.23 sets STDC_EXT


Hello,

I'm working on a HP-UX IA box:

$ uname -a
HP-UX t06 B.11.23 U ia64 2438279764 unlimited-user license

With gcc 3.3.2:

$ gcc --version
gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


When I try to compile this file:

#include <net/if.h>

int main()
{
}

With gcc, everything works fine. But if I use g++, not ok:

$ g++ -c test.c -o test


In file included from test.c:1:
/usr/include/net/if.h:181: error: 'uint64_t' is used as a type, but is not defined as a type.


But, if I use g++ with "-U__STDC_EXT__" (or -mlp64, but I need -milp32 to work), it works:

$ g++ -U__STDC_EXT__ -c test.c -o test


<command line>:4:1: warning: undefining "__STDC_EXT__" $

The problem seems to be with a line in net/if.h:

/* Note: The extended flags field "ifru_xflags" is a uint64_t which is not
 * a valid type for strict ANSI C compilation for ILP32. Applications that
 * need access to extended flags field should be compiled in extended ANSI
 * (-Ae) or LP64 mode.
 */

#if defined(__STDC_EXT__) || defined(__LP64__)

Is there a better way to do this than by undefining __STDC_EXT__? Or is it be safe to undefine that? I've tried searching google and these mailing lists with no luck... Or should I be sending this question to HP?

Thanks-
Ryan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]