Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2003 18:20:33 +0100
From:      Boris Nikolaus <boris@cs.tu-berlin.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   standards/50257: _POSIX_C_SOURCE is undefined warnings in sys/cdefs.h when -Wundef enabled
Message-ID:  <20030324172032.GA2128@fiesta.cs.tu-berlin.de>

next in thread | raw e-mail | index | archive | help

>Number:         50257
>Category:       standards
>Synopsis:       _POSIX_C_SOURCE is undefined warnings in sys/cdefs.h when -Wundef enabled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 24 09:30:10 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Boris Nikolaus
>Release:        FreeBSD 4.8-RC i386
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: FreeBSD XXXXXX 4.8-RC FreeBSD 4.8-RC #1: Tue Mar 18 11:49:23 CET 2003 root@XXXXXX:/usr/src/sys/compile/XXXXXX i386
>Description:
	When sys/cdefs.h is included (e. g. from sys/types.h) and gcc's
	warning option -Wundef is enabled, you get the following output:

		In file included from /usr/include/sys/types.h:45,
				 from tst.c:1:
		/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
		/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined

>How-To-Repeat:
	echo "#include <sys/types.h>" >tst.c
	gcc -c -Wundef tst.c

>Fix:
	Replace
		#if _POSIX_C_SOURCE == 1
	by
		#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
	(and similar for "== 2") in sys/cdefs.h.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030324172032.GA2128>