[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[james@nocrew.org: Bug#155100: glibc-doc: misleading definition of struct timeval from <sys/time.h>]



----- Forwarded message from James Troup <james@nocrew.org> -----

Subject: Bug#155100: glibc-doc: misleading definition of struct timeval from <sys/time.h>
Reply-To: James Troup <james@nocrew.org>, 155100@bugs.debian.org
Resent-From: James Troup <james@nocrew.org>
Original-Sender: James Troup <james@ruari-quinn.demon.co.uk>
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: Ben Collins <bcollins@debian.org>, glibc@packages.qa.debian.org
Resent-Date: Thu, 01 Aug 2002 12:33:06 GMT
Resent-Message-ID: <handler.155100.B.102820456711886@bugs.debian.org>
X-Debian-PR-Message: report 155100
X-Debian-PR-Package: glibc-doc
X-Debian-PR-Keywords: 
To: submit@bugs.debian.org
Mail-Copies-To: never
From: James Troup <james@nocrew.org>
Resent-Sender: Debian BTS <debbugs@master.debian.org>
X-Spam-Status: No, hits=-4.5 required=5.0 tests=SENT_BY_BTS,FORGED_RCVD_FOUND version=2.20
X-Spam-Level: 

Package: glibc-doc
Version: 2.2.5-6

glibc's docs say:

|  - Data Type: struct timeval
|      The `struct timeval' structure represents an elapsed time.  It is
|      declared in `sys/time.h' and has the following members:
| 
|     `long int tv_sec'
|           This represents the number of whole seconds of elapsed time.
| 
|     `long int tv_usec'
|           This is the rest of the elapsed time (a fraction of a second),
|           represented as the number of microseconds.  It is always less
|           than one million.

but... SuS says:

| The <sys/time.h> header shall define the timeval structure that
| includes at least the following members:
| 
| time_t         tv_sec     Seconds. 
| suseconds_t    tv_usec    Microseconds. 

and:

| The type suseconds_t shall be a signed integer type capable of storing
| values at least in the range [-1, 1000000]. [Option End]

and indeed sparc uses 'int' not 'long' for tv_usec.  Assuming Sparc's
include files aren't buggy, the documention should probably be fixed?
I'm not just reporting this to be pedantic, at least two -Werror using
packages have failed to build from source on sparc because they try to
format tv_usec with %ld.

-- 
James


----- End forwarded message -----

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://linux1394.sourceforge.net/
Subversion - http://subversion.tigris.org/
Deqo       - http://www.deqo.com/



Reply to: