Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - unistd.h fails when -std=c99 is defined: (2 Items)
   
unistd.h fails when -std=c99 is defined  
Some packages of pkgsrc are triggering this error message:

/usr/qnx632/target/qnx6/usr/include/unistd.h:135:2: #error _POSIX_VERSION not configured for system


Here is a small example to verify the behavior:

$ cat unistd.c
#include <unistd.h>

$ cc unistd.c

(no messages -> works)

$ cc -std=c99 unistd.c
In file included from unistd.c:1:
/usr/qnx632/target/qnx6/usr/include/unistd.h:135:2: #error _POSIX_VERSION not configured for system

$ cc --version
cc (GCC) 3.3.5 (qnx-nto)
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.

I'm using the Momentics 6.3.2 plus the utility package of pkgsrc.


Cited from the gcc 3.3.5 manual:

-std=
    Determine the language standard. This option is currently only supported when compiling C or C++. A value for this 
option must be provided; possible values are
[...]
    `c99'
        ISO C99. Note that this standard is not yet fully supported; see http://gcc.gnu.org/gcc-3.3/c99status.html for 
more information. The names `c9x' and `iso9899:199x' are deprecated.


Here is another example of the same error that is NOT related to the std option:

package devel/py-gobject in directory
/usr/src/HEAD/pkgsrc/devel/py-gobject/work/pygobject-2.12.3/gobject:

 cc -DHAVE_CONFIG_H -I. -I.. -I/usr/src/HEAD/pkgsrc/devel/py-gobject/work/.buildlink/include/python2.4 -D_REENTRANT -I/
usr/src/HEAD/pkgsrc/devel/py-gobject/work/.buildlink/include/glib/glib-2.0 -I/usr/src/HEAD/pkgsrc/devel/py-gobject/work/
.buildlink/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN -I/usr/src/HEAD/pkgsrc/devel/py-gobject/work/.buildlink/include -O2 -
Wall -std=c9x -fno-strict-aliasing -MT _gobject_la-gobjectmodule.lo -MD -MP -MF .deps/_gobject_la-gobjectmodule.Tpo -c 
gobjectmodule.c  -fPIC -DPIC -o .libs/_gobject_la-gobjectmodule.o
In file included from /usr/src/HEAD/pkgsrc/devel/py-gobject/work/.buildlink/include/python2.4/Python.h:41,
                 from pygobject.h:5,
                 from pygobject-private.h:9,
                 from gobjectmodule.c:27:
/usr/qnx632/target/qnx6/usr/include/unistd.h:135:2: #error _POSIX_VERSION not configured for system





Re: unistd.h fails when -std=c99 is defined  
On Thu, Dec 13, 2007 at 05:10:19AM -0500, Christian Leutloff wrote:
> Some packages of pkgsrc are triggering this error message:
> 
> /usr/qnx632/target/qnx6/usr/include/unistd.h:135:2: #error
> _POSIX_VERSION not configured for system
> 
> 
> Here is a small example to verify the behavior:
> 
> $ cat unistd.c
> #include <unistd.h>
> 
> $ cc unistd.c
> 
> (no messages -> works)
> 
> $ cc -std=c99 unistd.c
> In file included from unistd.c:1:
> /usr/qnx632/target/qnx6/usr/include/unistd.h:135:2: #error
> _POSIX_VERSION not configured for system

This is fixed in the latest unistd.h.  For now
you can just get rid of that #error:


--- unistd.h.orig	2006-02-22 16:14:00.000000000 -0500
+++ unistd.h	2007-12-14 10:10:55.000000000 -0500
@@ -131,8 +131,6 @@
 #define _POSIX_VERSION		199009L
 #elif defined(__EXT_POSIX1_198808)
 #define _POSIX_VERSION		198808L
-#else
-#error _POSIX_VERSION not configured for system
 #endif
 #endif


-seanb