From nobody@FreeBSD.org  Sat Nov 20 13:50:17 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D539216A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Nov 2004 13:50:17 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A3AE443D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Nov 2004 13:50:17 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id iAKDoHs5025157
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Nov 2004 13:50:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id iAKDoH33025154;
	Sat, 20 Nov 2004 13:50:17 GMT
	(envelope-from nobody)
Message-Id: <200411201350.iAKDoH33025154@www.freebsd.org>
Date: Sat, 20 Nov 2004 13:50:17 GMT
From: Satoshi Kimura <satosi.kimura@nifty.ne.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Warnings concerned with header files
X-Send-Pr-Version: www-2.3

>Number:         74159
>Category:       kern
>Synopsis:       [headers] [patch] fix warnings concerned with header files
>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:   Sat Nov 20 13:50:18 GMT 2004
>Closed-Date:    Sun Feb 24 01:27:56 UTC 2008
>Last-Modified:  Sun Feb 24 01:30:02 UTC 2008
>Originator:     Satoshi Kimura
>Release:        FreeBSD 4.9
>Organization:
personal use
>Environment:
FreeBSD 4.9-RELEASE #0: Wed Oct 29 02:43:54 2003
    root@kcesx20.koganemaru.co.jp:/usr/src/sys/compile/GENERIC98

>Description:
      Use following source "sample.c" as an example.
#include <stdio.h>
#include <sys/kbio.h>
#include <machine/mouse.h>

int main(void) { }

If compile it with "-Wundef" option like
% /usr/bin/gcc -Wundef sample.c -o sample 
following warnings were shown.

> In file included from /usr/include/stdio.h:43,
>                  from sample.c:2:
> /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
> In file included from sample.c:3:
> /usr/include/sys/kbio.h:24: warning: `notdef' is not defined
> /usr/include/sys/kbio.h:64: warning: `notdef' is not defined
> /usr/include/sys/kbio.h:214: warning: `notdef' is not defined
> In file included from sample.c:4:
> /usr/include/machine/mouse.h:44: warning: `notyet' is not defined

>How-To-Repeat:
      See above example.
Or, for example, at making XFree86 or Xorg, warning concerned with
cdefs.h were shown about 4,000 times! (16,000 lines!)

>Fix:
      To avoid these warnings, modify some header files as follows.
(1) /usr/include/sys/cdefs.h
#if _POSIX_C_SOURCE == 1
is to be modified to
#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE == 1

(2) /usr/include/sys/kbio.h
#if notdef
is to be modified to
#if defined notdef && notdef
or probably to
#ifdef notdef

(3) /usr/include/machine/mouse.h
#if notyet
is to be modified to
#if defined notyet && notyet
or probably to
#ifdef notyet

Following patch is available for all modifications.
begin 644 patch.gz
M'XL("$W.D4$``W!A=&-H`)V376^B0!2&K_%7G,2DW591&*FM)DUDA6V,50S0
M=/>*(`XR*64:P37NK]\9H/+AQVYZH\G,>\Z<]^$]HBA"O(^[W@K[<2?HT,U:
ML+<8#"\!]`"2-$2]H2(!DJ1>H]5JE<7"*U[!G/X&60*Y/[Q#0Z7/A4IC-`(1
MW4MMN0>M_'\T:@#<=AO0@.XM:-@-84>2`":ZKH.5K#JLB]3KR*(\&$AM(!'L
M`N(%X"P,:_+3&3N6\6*.=7A\!+G#&XE-XI^\;;3X#1N11&R^NN+JZG01-+<1
MJZE?"@*;=K&A2W<9[H&$(5Z[81N6VP26>$^C%7CNAD1KB.@N'0N:V<O"42-N
M3!HP`8Y6Q/\7",1!H,L@T$40Z"L@T#D0EXVADC$QC]3;DM#_352FK0=*&2)4
M"I3<OF=QXK\\3/DX,-5F4]N8ZX(S,;Y=3Z_;\,#`<G`)HW.3<XXQ!H]&,0UQ
M)P"?;B`)<,:&)(1=`/73(Y^&(=WQ+TJHEX3Q@7!$$R:O,LW..,K\MC35DV[/
M#"T=R\SF&J1#W91%5B'*-,QY9?B2]+MA:KI9DO8J4HZHGR+J'R-B[YBJ5M3V
M[[_`Z`RB+Q,R5<O.#+U^FF>;'WL;)R9_L).2^MR5+`!Y`C[]%<T8[!]3_9>0
M-F.XWU@WULM_PWMWLW;*T*T34KDB+9E)U[_*A;F]Z/!D13'HQ'"LL3F?J8L\
M&?Q]E-I^=S\JDRZJVM=,VZMJBYU[=[V`E77?Z3;&9Q=/+A:O5G"\?7=*L7U*
MREZI1VMFO%BZ8^JJ9MFJK1^HSO@>MB%MO7(3MV*L*-)46ZW4#.HUAZ^QQ\D1
M>':6@^>WM?X\\[IE/+_8$V.>`YRE*:OOX4%OC=7GR?RI+);/BLV#WUR*<NE?
(W)%#/50'````
`
end


>Release-Note:
>Audit-Trail:

From: Volker <volker@vwsoft.com>
To: bug-followup@FreeBSD.org, satosi.kimura@nifty.ne.jp
Cc:  
Subject: Re: kern/74159: [headers] [patch] fix warnings concerned with header
 files
Date: Sat, 23 Feb 2008 00:09:43 +0100

 Satoshi,
 
 I've compiled your test code (using #include <sys/mouse.h>) and gcc did
 not fire any warning on RELENG_7 (even with -Wall). Your problem may
 still be true for older releases but is not seen anymore for a recent
 release.
 
 Do you agree to close this PR?
 
 Thanks!
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sat Feb 23 03:14:28 UTC 2008 
State-Changed-Why:  
Note that submitter has been asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74159 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Feb 24 01:27:37 UTC 2008 
State-Changed-Why:  
Submitter agrees that this can be closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74159 

From: linimon@lonesome.com (Mark Linimon)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/74159: [headers] [patch] fix warnings concerned with header files
Date: Sat, 23 Feb 2008 19:25:28 -0600

 ----- Forwarded message from Satoshi Kimura <satosi.kimura@nifty.com> -----
 
 To: volker@vwsoft.com
 Cc: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org
 From: Satoshi Kimura <satosi.kimura@nifty.com>
 
 Hi Volker,
 
 > Your problem may
 > still be true for older releases but is not seen anymore for a recent
 > release.
 
   I had sent a patch for three files, and result was as follows:
 (1) sys/cdefs.h : already modified (at least 6.2-RELEASE)
 (2) sys/kbio.h  : not modified.
 (3) machine/mouse.h : not modified. (now, sys/mouse.h)
 
 As you pointed out, (2), (3) makes no warning on new gcc.
 (In principle, (1) also makes no problem, even if not modified.)
 
 > Do you agree to close this PR?
   yes.
 
 Sincerely yours.
 
 ----- End forwarded message -----
>Unformatted:
