From owner-freebsd-bugs@FreeBSD.ORG Sat Nov 20 13:50:19 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4577816A4CE for ; Sat, 20 Nov 2004 13:50:19 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FF6743D39 for ; Sat, 20 Nov 2004 13:50:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id iAKDoJEK087386 for ; Sat, 20 Nov 2004 13:50:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id iAKDoIOs087384; Sat, 20 Nov 2004 13:50:18 GMT (envelope-from gnats) Resent-Date: Sat, 20 Nov 2004 13:50:18 GMT Resent-Message-Id: <200411201350.iAKDoIOs087384@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Satoshi Kimura Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D539216A4CE for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/74159: Warnings concerned with header files X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2004 13:50:19 -0000 >Number: 74159 >Category: misc >Synopsis: Warnings concerned with header files >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Nov 20 13:50:18 GMT 2004 >Closed-Date: >Last-Modified: >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 #include #include 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;'WL;)R9_L).2^MR5+`!Y`C[]%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*Release-Note: >Audit-Trail: >Unformatted: