From bminard@certicom.com  Tue Jan 21 07:54:48 2003
Return-Path: <bminard@certicom.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 524AC37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jan 2003 07:54:48 -0800 (PST)
Received: from ns.ca.certicom.com (ns.ca.certicom.com [66.48.18.197])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8DF4A43F5B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jan 2003 07:54:46 -0800 (PST)
	(envelope-from bminard@certicom.com)
Received: from smtpmail.certicom.com (domino2.certicom.com [10.0.1.25])
	by ns.ca.certicom.com (Postfix) with SMTP id AB386592D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jan 2003 10:52:25 -0500 (EST)
Received: from ce00182.certicom.com ([10.0.2.59]) by smtpmail.certicom.com (Lotus SMTP MTA v4.6.4  (830.2 3-23-1999)) with SMTP id 85256CB5.0056B39D; Tue, 21 Jan 2003 10:47:00 -0500
Received: from ce00182.certicom.com (localhost.certicom.com [127.0.0.1])
	by ce00182.certicom.com (8.12.6/8.12.6) with ESMTP id h0LFrax1069184
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jan 2003 10:53:36 -0500 (EST)
	(envelope-from bminard@ce00182.certicom.com)
Received: (from bminard@localhost)
	by ce00182.certicom.com (8.12.6/8.12.6/Submit) id h0LFrZeI069183;
	Tue, 21 Jan 2003 10:53:36 -0500 (EST)
	(envelope-from bminard)
Message-Id: <200301211553.h0LFrZeI069183@ce00182.certicom.com>
Date: Tue, 21 Jan 2003 10:53:36 -0500 (EST)
From: Brian Minard <bminard@certicom.com>
Reply-To: Brian Minard <bminard@certicom.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: -Wundef generates warning when compiling with /usr/include/sys/cdefs.h
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47300
>Category:       i386
>Synopsis:       -Wundef generates warning when compiling with /usr/include/sys/cdefs.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 21 08:00:17 PST 2003
>Closed-Date:    Thu Feb 06 16:39:50 PST 2003
>Last-Modified:  Thu Feb 06 16:39:50 PST 2003
>Originator:     Brian Minard
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
Certicom Corp.
>Environment:
System: FreeBSD 4.7-STABLE FreeBSD 4.7-STABLE: Sun Dec 1 07:30:05 EST 2002 i386


>Description:
	Using the GCC compiler option -Wundef on source using the file
	/usr/include/sys/cdefs.h causes a compiler warning.
>How-To-Repeat:
	Use the named compiler option when compiling a program requiring said file.
>Fix:

Apply the following patch:


Index: cdefs.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/cdefs.h,v
retrieving revision 1.28.2.8
diff -c -r1.28.2.8 cdefs.h
*** cdefs.h	2002/09/18 04:05:13	1.28.2.8
--- cdefs.h	2003/01/21 15:24:35
***************
*** 270,275 ****
--- 270,276 ----
   */
  
  /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
+ #ifdef _POSIX_C_SOURCE
  #if _POSIX_C_SOURCE == 1
  #undef _POSIX_C_SOURCE		/* Probably illegal, but beyond caring now. */
  #define	_POSIX_C_SOURCE		199009
***************
*** 279,284 ****
--- 280,286 ----
  #if _POSIX_C_SOURCE == 2
  #undef _POSIX_C_SOURCE
  #define	_POSIX_C_SOURCE		199209
+ #endif
  #endif
  
  /* Deal with various X/Open Portability Guides and Single UNIX Spec. */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mike 
State-Changed-When: Thu Feb 6 16:36:06 PST 2003 
State-Changed-Why:  

Undefined preprocessor tokens are converted to 0 before evaluation, so 
this isn't a real problem.  I would advice against using -Wundef 
unless you don't mind false positives like this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47300 
>Unformatted:
