Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!uflorida!gatech!galbp!bwilab3!chris From: chris@bwilab3.UUCP (Chris Curtin) Newsgroups: comp.sys.hp Subject: _HPUX_SOURCE Defintion and ANSI C Keywords: ANSI C Message-ID: <136@bwilab3.UUCP> Date: 19 Dec 90 19:08:53 GMT Organization: Bradley Ward Inc., Atlanta, Ga Lines: 49 Hello, I am trying to write ANSI C programs that use calls to UN*X specific functions. When compiling in ANSI mode i.e. -Aa the compiler cannot find function prototypes and definitions in some header files. In non ANSI mode the definitions are found. I was told to resolve this problem by #defining _HPUX_SOURCE. This solves the problem of the compiler not finding the prototypes but raises some questions about what it does. I was also told, by someone else, that the _HPUX_SOURCE tells the compiler that I am compiling kernel code. Is this true? Is there a better way to get access to the routines than _HPUX_SOURCE? What problems am I opening up by using this? (i.e. am I allowing access to kernel routines that I am not supposed to?) Info about our system: HP 9000-835 HP-UX 7.0 HP C Compiler A.07.10 Also, i have noticed that the semun union is not defined in the header file. We had to define our own to be able to use semaphores in ANSI mode. The header files that did not include the proper defs without _HPUX_SOPURCE, that I used are: and - These are the ones that I have found and I am sure that the others have the same problems. Any suggestions or comments are welcome. Thanks Chris -- Christopher M. Curtin Bradley Ward Inc. Atlanta Ga. { ..!gatech!galbp!bwilab3!chris}