From james@jraynard.demon.co.uk  Tue May 21 12:29:21 1996
Received: from relay-2.mail.demon.net (disperse.demon.co.uk [158.152.1.77])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA21543
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 May 1996 12:29:04 -0700 (PDT)
Received: from post.demon.co.uk ([158.152.1.72]) by relay-2.mail.demon.net
          id aq09947; 21 May 96 18:47 +0100
Received: from jraynard.demon.co.uk ([158.152.42.77]) by relay-3.mail.demon.net
          id aa00452; 21 May 96 18:22 +0100
Received: (from james@localhost) by jraynard.demon.co.uk (8.7.5/8.6.12) id NAA04252; Tue, 21 May 1996 13:45:59 GMT
Message-Id: <199605211345.NAA04252@jraynard.demon.co.uk>
Date: Tue, 21 May 1996 13:45:59 GMT
From: James Raynard <james@jraynard.demon.co.uk>
Reply-To: james@jraynard.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: redundant redeclaration of `lseek'
X-Send-Pr-Version: 3.2

>Number:         1229
>Category:       bin
>Synopsis:       redundant redeclaration of `lseek'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bde
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 21 12:30:00 PDT 1996
>Closed-Date:    Sat Jun 21 10:46:12 PDT 1997
>Last-Modified:  Sat Jun 21 10:48:40 PDT 1997
>Originator:     James Raynard
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
A FreeBSD-current box
>Environment:

FreeBSD 2.2-CURRENT as of 19th May

>Description:

sys/types.h has a prototype for lseek(). So does unistd.h, which 
#include's sys/types.h

>How-To-Repeat:

Compile anything that #include's unistd.h, with -Wredundant-decls.

>Fix:
	
Remove lseek() prototype from unistd.h

*** /usr/src/include/unistd.h~	Tue May 21 14:01:09 1996
--- /usr/src/include/unistd.h	Tue May 21 14:01:18 1996
***************
*** 79,85 ****
  uid_t	 getuid __P((void));
  int	 isatty __P((int));
  int	 link __P((const char *, const char *));
- off_t	 lseek __P((int, off_t, int));
  long	 pathconf __P((const char *, int));
  int	 pause __P((void));
  int	 pipe __P((int *));
--- 79,84 ----

>Release-Note:
>Audit-Trail:

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

From: James Raynard <james@jraynard.demon.co.uk>
To: bde@zeta.org.au
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1229: redundant redeclaration of `lseek'
Date: Sat, 25 May 1996 01:17:34 GMT

 > >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:
 
 Thanks, I see the point of it now. Do I get the impression, reading
 between the lines, that you would like to have a different compiler
 available? 8-)
 
 BTW, I don't know if you remember the discussion on -hackers a couple
 of weeks ago about system() and popen(), but I now have about 1000
 lines of diffs to libc. They've been running on my system for a few
 days without any obvious problems, although that probably doesn't
 prove much. (I've had quite a few other problems, but they've been
 going on since the VM check-in).
 
 Is there anywhere I should send them to?
 
 -- 
 James Raynard, Edinburgh, Scotland
 jraynard@dial.pipex.com
 james@jraynard.demon.co.uk

From: James Raynard <james@jraynard.demon.co.uk>
To: bde@zeta.org.au
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1229: redundant redeclaration of `lseek'
Date: Sat, 25 May 1996 01:17:34 GMT

 > >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:
 
 Thanks, I see the point of it now. Do I get the impression, reading
 between the lines, that you would like to have a different compiler
 available? 8-)
 
 BTW, I don't know if you remember the discussion on -hackers a couple
 of weeks ago about system() and popen(), but I now have about 1000
 lines of diffs to libc. They've been running on my system for a few
 days without any obvious problems, although that probably doesn't
 prove much. (I've had quite a few other problems, but they've been
 going on since the VM check-in).
 
 Is there anywhere I should send them to?
 
 -- 
 James Raynard, Edinburgh, Scotland
 jraynard@dial.pipex.com
 james@jraynard.demon.co.uk
State-Changed-From-To: open->analyzed 
State-Changed-By: wosch 
State-Changed-When: Wed Sep 18 14:34:53 PDT 1996 
State-Changed-Why:  
Bruce's area. 


Responsible-Changed-From-To: freebsd-bugs->bde 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Sep 18 14:34:53 PDT 1996 
Responsible-Changed-Why:  
State-Changed-From-To: analyzed->closed 
State-Changed-By: bde 
State-Changed-When: Sat Jun 21 10:46:12 PDT 1997 
State-Changed-Why:  

Fixed in -current on 1997/04/13. 
Fixed in -2.2.x on 1997/06/21. 
I don't plan to fix it in 2.1.x. 
>Unformatted:
