Date: Mon, 13 Aug 2001 17:00:05 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/29675: lint fails on stdio.h Message-ID: <200108140000.f7E005k09319@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/29675; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: Walter Campbell <wcampbel@botbay.net> Cc: <FreeBSD-gnats-submit@FreeBSD.ORG> 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 <sys/cdef.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108140000.f7E005k09319>