This is the mail archive of the gcc-patches@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]

Re: Patch: tfformat.c doesn't compile under hpux 10.20


> Perhaps the testsuite should be building with -ansi?  That should turn
> off the HPUX extensions.

I was considering a similar approach but I think -ansi may be a bit too
restrictive.  I suggest `-undef -ansi -D_XOPEN_SOURCE'.  Here are
the defines from a simple module that just includes sys/stdsyms.h
under hpux 10.20:

#define _INCLUDE_XOPEN_SOURCE
#define __STRICT_ANSI__ 1
#define _PROTOTYPES
#define _PA_RISC1_1 1
#define __hp9000s700 1
#define _INCLUDE__STDC__
#define __GNUC_MINOR__ 95
#define _XPG4
#define _WSIO
#define _INCLUDE_POSIX2_SOURCE
#define _SYS_STDSYMS_INCLUDED
#define __GNUC__ 2
#define _XOPEN_SOURCE 1
#define _INCLUDE_POSIX_SOURCE

This gives us includes per POSIX.2 (IEEE Standard 1003.2-1990) and
XPG4 (X/Open Portability Guide Issue 4).  The defaults will vary from
somewhat from system to system.  However, the result will be much better
defined than using the default namespace for each system.

I will give this a try and see what happens.  The problematic defines
in stdlib.h are already wrapped in _INCLUDE_HPUX_SOURCE. Thus if the above
works, no change would be needed to the header file.

>   > Does the hpux community think that this misfeature should be fixed? 
> My experience is that we need to have _HPUX_SOURCE defined or the system
> is basically unusable.

This is probably true but I haven't really tried using the POSIX or XOPEN
namespaces.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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