From owner-freebsd-stable Wed Aug 21 22:15: 7 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C93AB37B405 for ; Wed, 21 Aug 2002 22:15:03 -0700 (PDT) Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BC4143E86 for ; Wed, 21 Aug 2002 22:15:03 -0700 (PDT) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id WAA97747 for ; Wed, 21 Aug 2002 22:03:14 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g7M52Rh09296 for freebsd-stable@freebsd.org; Wed, 21 Aug 2002 22:02:27 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200208220502.g7M52Rh09296@arch20m.dellroad.org> Subject: stdio.h patch To: freebsd-stable@freebsd.org Date: Wed, 21 Aug 2002 22:02:27 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, Does anyone object to the patch below? It fixes this warning when compiling with -Wnested-externs and -D_THREAD_SAFE (am I the only one who ever does that??) /usr/include/stdio.h: In function `__getc_locked': /usr/include/stdio.h:418: warning: nested extern declaration of `__isthreaded' /usr/include/stdio.h: In function `__putc_locked': /usr/include/stdio.h:430: warning: nested extern declaration of `__isthreaded' The fix is to declare '__isthreaded' at the top level. My understanding of things is that this should be OK because the name begins with two underscores (but I could be wrong about that). Also, it removes a bunch of backslash contiunations that are not needed. FYI, this is not an issue in -current. Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com Index: stdio.h =================================================================== RCS file: /home/ncvs/src/include/stdio.h,v retrieving revision 1.24.2.2 diff -u -r1.24.2.2 stdio.h --- stdio.h 5 Dec 2001 20:48:07 -0000 1.24.2.2 +++ stdio.h 22 Aug 2002 05:01:24 -0000 @@ -415,29 +415,28 @@ #else #define _FLOCKFILE(x) flockfile(x) #endif -static __inline int \ -__getc_locked(FILE *_fp) \ -{ \ - extern int __isthreaded; \ - int _ret; \ - if (__isthreaded) \ - _FLOCKFILE(_fp); \ - _ret = getc_unlocked(_fp); \ - if (__isthreaded) \ - funlockfile(_fp); \ - return (_ret); \ +extern int __isthreaded; +static __inline int +__getc_locked(FILE *_fp) +{ + int _ret; + if (__isthreaded) + _FLOCKFILE(_fp); + _ret = getc_unlocked(_fp); + if (__isthreaded) + funlockfile(_fp); + return (_ret); } -static __inline int \ -__putc_locked(int _x, FILE *_fp) \ -{ \ - extern int __isthreaded; \ - int _ret; \ - if (__isthreaded) \ - _FLOCKFILE(_fp); \ - _ret = putc_unlocked(_x, _fp); \ - if (__isthreaded) \ - funlockfile(_fp); \ - return (_ret); \ +static __inline int +__putc_locked(int _x, FILE *_fp) +{ + int _ret; + if (__isthreaded) + _FLOCKFILE(_fp); + _ret = putc_unlocked(_x, _fp); + if (__isthreaded) + funlockfile(_fp); + return (_ret); } #define getc(fp) __getc_locked(fp) #define putc(x, fp) __putc_locked(x, fp) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message