Date: Tue, 21 May 1996 22:20:03 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs Subject: Re: bin/1229: redundant redeclaration of `lseek' Message-ID: <199605220520.WAA16641@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/1229; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: FreeBSD-gnats-submit@freebsd.org, james@jraynard.demon.co.uk Cc: Subject: Re: bin/1229: redundant redeclaration of `lseek' Date: Wed, 22 May 1996 15:08:02 +1000 >sys/types.h has a prototype for lseek(). So does unistd.h, which >#include's sys/types.h It really shouldn't be declared in <sys/types.h> if _POSIX_SOURCE is defined. I want the kludge of declaring lseek() in <sys/types.h> extended: - put a prototype for all functions that return a quad value or take a quad value arg in a central place. Hi-tech place: compiler builtin. Low-tech place(s): <sys/types.h>, <stdio.h>, ... - turn off this kludge if _ANSI_SOURCE or _POSIX_SOURCE is defined. - inhibit warnings about multiple declarations of these functions in system headers. (It is too hard to fix the bogus warning for lseek() being declared in <sys/types.h> and in user code that doesn't include <unistd.h>, unless lseek() is a builtin.) - don't include <sys/types.h> in <stdio.h>. It is included mainly to pick up the declaration of lseek(). Quad values in printf args should be checked even if -Wformat is not specified. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605220520.WAA16641>