From owner-freebsd-bugs Mon Aug 13 17: 0:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9F89837B40E for ; Mon, 13 Aug 2001 17:00:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7E005k09319; Mon, 13 Aug 2001 17:00:05 -0700 (PDT) (envelope-from gnats) Date: Mon, 13 Aug 2001 17:00:05 -0700 (PDT) Message-Id: <200108140000.f7E005k09319@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: bin/29675: lint fails on stdio.h Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/29675; it has been noted by GNATS. From: Bruce Evans To: Walter Campbell Cc: Subject: Re: bin/29675: lint fails on stdio.h Date: Tue, 14 Aug 2001 09:53:56 +1000 (EST) On Mon, 13 Aug 2001, Walter Campbell wrote: > >Description: > > lint(1) will fail on C files that include stdio.h > > >How-To-Repeat: > > wcampbel@botbay (alis-2.2beta2.patched): lint -aacgprxhH *.c > alis.c: > stdio.h:299: syntax error > ... > This happens with make lint on ircd-hybrid 6.2rc1 > ... What version of lint is in that? I think thre is no problem here with FreeBSD lint, but stdio.h is certainly broken for most foreign versions of lint, compilers other than gcc, and old version of gcc. The hard-coded __attribute__(()) in it needs to be ifdef'ed, not quite as in the following patch. --- Index: stdio.h =================================================================== RCS file: /home/ncvs/src/include/stdio.h,v retrieving revision 1.34 diff -u -2 -r1.34 stdio.h --- stdio.h 2001/04/22 01:56:08 1.34 +++ stdio.h 2001/05/04 02:28:31 @@ -69,7 +69,4 @@ }; -/* hold a buncha junk that would grow the ABI */ -struct __sFILEX; - /* * stdio state variables. @@ -116,5 +113,5 @@ /* separate buffer for long sequences of ungetc() */ struct __sbuf _ub; /* ungetc buffer */ - struct __sFILEX *_extra; /* additions to FILE to not break ABI */ + struct __sFILEX *_extra; /* additions to FILE to not break ABI */ int _ur; /* saved _r when _r is counting ungetc data */ @@ -263,7 +260,4 @@ FILE *fdopen __P((int, const char *)); int fileno __P((FILE *)); -int ftrylockfile __P((FILE *)); -void flockfile __P((FILE *)); -void funlockfile __P((FILE *)); __END_DECLS #endif /* not ANSI */ @@ -300,10 +294,16 @@ int asprintf __P((char **, const char *, ...)) __printflike(2, 3); char *ctermid_r __P((char *)); -__const char *fmtcheck __P((const char *, const char *)) - __attribute__((__format_arg__(2))); char *fgetln __P((FILE *, size_t *)); +void flockfile __P((FILE *)); +__const char *fmtcheck __P((const char *, const char *)) +#ifdef __GNUC__ + __attribute__((__format_arg__(2))) +#endif + ; int fpurge __P((FILE *)); int fseeko __P((FILE *, _BSD_OFF_T_, int)); _BSD_OFF_T_ ftello __P((FILE *)); +int ftrylockfile __P((FILE *)); +void funlockfile __P((FILE *)); int getw __P((FILE *)); int pclose __P((FILE *)); @@ -349,7 +349,7 @@ __BEGIN_DECLS int __srget __P((FILE *)); -int __vfscanf __P((FILE *, const char *, _BSD_VA_LIST_)); int __svfscanf __P((FILE *, const char *, _BSD_VA_LIST_)); int __swbuf __P((int, FILE *)); +int __vfscanf __P((FILE *, const char *, _BSD_VA_LIST_)); __END_DECLS --- Don't use the other parts of this patch. A more complicated ifdef like the ones in is required to support old versions of gcc. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message