Operating System - HP-UX
1752866 Members
3621 Online
108791 Solutions
New Discussion

_XOPEN_SOURCE_EXTENDED question

 
E. Brown
Advisor

_XOPEN_SOURCE_EXTENDED question

Hi All

Here are my settings:

uname –a: HP-UX HP-C8000 B.11.11 U 9000/785 220365262 unlimited-user license

gcc: gcc (GCC) 4.3.1

Qt config: ./configure –platform hp-g++-64

Here is my problem:

Attempting to configure produces the following error.

/opt/hp-gcc64/bin/g++ -c -o makefiledeps.o -D_HPUX_SOURCE -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igener
ators/mac -I/space2/sources/trolltech/download/qt-x11-commercial-src-4.4.2/include -I/space2/sources/trolltech/download/
qt-x11-commercial-src-4.4.2/include/QtCore -I/space2/sources/trolltech/download/qt-x11-commercial-src-4.4.2/include -I/s
pace2/sources/trolltech/download/qt-x11-commercial-src-4.4.2/include/QtCore -I/space2/sources/trolltech/download/qt-x11-
commercial-src-4.4.2/src/corelib/global -I/space2/sources/trolltech/download/qt-x11-commercial-src-4.4.2/src/script -DQT
_NO_PCRE -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_BUILD_QMAKE -DQT_NO_COMPRESS -I/spac
e2/sources/trolltech/download/qt-x11-commercial-src-4.4.2/mkspecs/hpux-g++-64 -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_
QOBJECT -DQT_NO_GEOM_VARIANT generators/makefiledeps.cpp
In file included from /usr/include/net/if.h:234, from /space2/sources/trolltech/download/qt-x11-commercial-src-4.4.2/mkspecs/hpux-g++-64/qplatformdefs.h
:56,
from generators/makefiledeps.cpp:28:
/usr/include/net/if6.h:77: error: field 'iflru_addr' has incomplete type
/usr/include/net/if6.h:78: error: field 'iflru_dstaddr' has incomplete type
/usr/include/net/if6.h:118: error: field 'lifra_addr' has incomplete type
/usr/include/net/if6.h:119: error: field 'lifra_mask' has incomplete type
gmake: *** [makefiledeps.o] Error 1

Tracking this through on my system:

'iflru_addr', 'iflru_dstaddr', 'lifra_addr' and 'lifra_mask' are all instances of the sockaddr_ext struct which is defined in socket.h

#if !defined(_XOPEN_SOURCE_EXTENDED)
struct sockaddr_ext {
unsigned short sa_family; /* address family */
char sa_data[22]; /* up to 22 bytes of direct address */
};
#endif /* !_XOPEN_SOURCE_EXTENDED */

I understand that _XOPEN_SOURCE_EXTENDED should not be defined thus allowing sockaddr_ext to be created but putting in a #ifdef _XOPEN_SOURCE_EXTENDED #ERROR blah blah #endif before the #include call suggests that it is. I can't find where on my system this define is.

Searching this forum the following thread seems to describe the same problem...

http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1223633162475+28353475&threadId=1089588

In this instance sys/socket.h is being included and I wonder if anyone could give any clarification on whether and why the flags suggested would be applicable in this instance?

Thanks

Ed



4 REPLIES 4
Steven Schweda
Honored Contributor

Re: _XOPEN_SOURCE_EXTENDED question

> [...] the following thread seems to
> describe the same problem...

And this one may be vaguely similar:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1275847

(You don't need the "11" or "12", or the
"admit=" stuff when you cite a Forum item.)

"cc -E" might help you track down which
system header file gets the evil
_XOPEN_SOURCE_EXTENDED macro defined in your
case. I didn't persist in my persuit of a
good solution, however, so I have no really
satisfying advice to offer.
Dennis Handly
Acclaimed Contributor

Re: _XOPEN_SOURCE_EXTENDED question

>Steven: "cc -E" might help you track down which system header file gets the evil _XOPEN_SOURCE_EXTENDED macro defined in your case.

If you are debugging macros, you need to roll out the big guns:
aCC -E -.i -Wp,-C,-G
Also with Integrity add +legacy_cpp.
E. Brown
Advisor

Re: _XOPEN_SOURCE_EXTENDED question

Hi Steven, Dennis
Firstly thanks for the advice. I have some more information regarding this problem. Taking a step back I wrote a short program which includes the following pre-processor directives at the head of the file.

#ifdef _XOPEN_SOURCE
#error ** _XOPEN_SOURCE is defined **
#else
#error ** _XOPEN_SOURCE is NOT defined **
#endif

#ifdef _XOPEN_SOURCE_EXTENDED
#error ** the value is _XOPEN_SOURCE_EXTENDED is defined **
#else
#error ** the value is _XOPEN_SOURCE_EXTENDED is NOT defined **
#endif

I then compiled the program using first GCC 4.3.1 and secondly the HP aCC: HP ANSI C++ B3910B A.03.33. _XOPEN_SOURCE is not defined in both instances but _XOPEN_SOURCE_EXTENDED is defined for the GCC compilation which leads to my undefined sockaddr_ext struct. In the GCC documentation under HPPA options the following is statedâ ¦

`-munix=UNIX-STD'
Generate compiler predefines and select a startfile for the
specified UNIX standard. The choices for UNIX-STD are `93', `95'
and `98'. `93' is supported on all HP-UX versions. `95' is
available on HP-UX 10.10 and later. `98' is available on HP-UX
11.11 and later. The default values are `93' for HP-UX 10.00,
`95' for HP-UX 10.10 though to 11.00, and `98' for HP-UX 11.11 and
later.

`-munix=93' provides the same predefines as GCC 3.3 and 3.4.
`-munix=95' provides additional predefines for `XOPEN_UNIX' and
`_XOPEN_SOURCE_EXTENDED', and the startfile `unix95.o'.
`-munix=98' provides additional predefines for `_XOPEN_UNIX',
`_XOPEN_SOURCE_EXTENDED', `_INCLUDE__STDC_A1_SOURCE' and
`_INCLUDE_XOPEN_SOURCE_500', and the startfile `unix98.o'.

It is _important_ to note that this option changes the interfaces
for various library routines. It also affects the operational
behavior of the C library. Thus, _extreme_ care is needed in
using this option.

When I compile my test program with the '-muinx=93' switch both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED are both undefined.

Can you tell me how I can incorporate this command line option in GCC prior to running the Qt configure script? I have tried setting the CXXFLAGS and CPPFLAGS environment variables without success.

Thanks

Ed
Dennis Handly
Acclaimed Contributor

Re: _XOPEN_SOURCE_EXTENDED question

>Can you tell me how I can incorporate this command line option in GCC prior to running the Qt configure script?

I would have thought CXXFLAGS would do it. Can you look in the Qt configure script?

You could wrap this option with the compiler and then pass in something like:
./configure -platform hp-g++-64 cc="/opt/hp-gcc64/bin/g++ -muinx=93"

But you would want to use the one for C++.