Debian Bug report logs - #308359
getopt(3): return value description incomplete

version graph

Package: manpages-dev; Maintainer for manpages-dev is Martin Schulze <>; Source for manpages-dev is src:manpages.

Reported by: Philipp Spitzer <>

Date: Mon, 9 May 2005 18:33:01 UTC

Severity: minor

Tags: fixed-upstream

Found in version 1.70-1

Fixed in version manpages/2.04-1

Done: Martin Schulze <>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to, Martin Schulze <>:
Bug#308359; Package manpages-dev. Full text and rfc822 format available.

Acknowledgement sent to Philipp Spitzer <>:
New Bug report received and forwarded. Copy sent to Martin Schulze <>. Full text and rfc822 format available.

Message #5 received at (full text, mbox):

From: Philipp Spitzer <>
To: Debian Bug Tracking System <>
Subject: getopt(3): return value description incomplete
Date: Mon, 09 May 2005 20:17:53 +0200
Package: manpages-dev
Version: 1.70-1
Severity: minor

The current description of the return value of getopt() found in the
"The getopt() function returns the option character if the option  was
found  successfully,  ':'  if there was a missing parameter for one of
the options, '?' for an unknown option character, or -1 for the end of
the option list."

The function returns '?' instead of ':' if there were missing
parameters if the options string does not begin with ':'.

The description of the glibc-doc describes it correctly:
"If getopt finds an option character in argv that was not included in
options, or a missing option argument, it returns `?' and sets the
external variable optopt to the actual option character. If the first
character of options is a colon (`:'), then getopt returns `:' instead
of `?' to indicate a missing option argument. In addition, if the
external variable opterr is nonzero (which is the default), getopt
prints an error message."

The error can also be found in the german translation (and maybe other
translations) of the manpage.

Thank you,

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux
Locale: LANG=de_AT@euro, LC_CTYPE=de_AT@euro (charmap=ISO-8859-15)

Versions of packages manpages-dev depends on:
ii  manpages                      1.70-1     Manual pages about using a GNU/Lin

-- no debconf information

Information forwarded to, Martin Schulze <>:
Bug#308359; Package manpages-dev. Full text and rfc822 format available.

Acknowledgement sent to "Michael Kerrisk" <>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <>. Full text and rfc822 format available.

Message #10 received at (full text, mbox):

From: "Michael Kerrisk" <>
To: Martin Schulze <>
Subject: Re: #308359: getopt(3): return value description incomplete
Date: Tue, 21 Jun 2005 15:38:21 +0200 (MEST)
I agree -- the existing text is a bit broken.  I've rewritten it
for man-pages-2.04.  Please close this report.

The new text is:

       If an option was successfully found, then getopt() returns
       the  option  character.   If all command-line options have
       been  parsed,  then  getopt()  returns  -1.   If  getopt()
       encounters  an option character that was not in optstring,
       then '?' is returned.  If getopt()  encounters  an  option
       with  a missing argument, then the return value depends on
       the first character in optstring: if it is ':',  then  ':'
       is returned; otherwise '?' is returned.



Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  Grab the latest
tarball at
and grep the source files for 'FIXME'.

Please submit non-trivial man page suggestions as 
"diff -u" patches.

Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat:

Tags added: fixed-upstream Request was from Justin Pryzby <> to Full text and rfc822 format available.

Reply sent to Martin Schulze <>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Philipp Spitzer <>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #17 received at (full text, mbox):

From: Martin Schulze <>
Subject: Bug#308359: fixed in manpages 2.04-1
Date: Sat, 12 Nov 2005 22:17:17 -0800
Source: manpages
Source-Version: 2.04-1

We believe that the bug you reported is fixed in the latest version of
manpages, which is due to be installed in the Debian FTP archive:

  to pool/main/m/manpages/manpages-dev_2.04-1_all.deb
  to pool/main/m/manpages/manpages_2.04-1.diff.gz
  to pool/main/m/manpages/manpages_2.04-1.dsc
  to pool/main/m/manpages/manpages_2.04-1_all.deb
  to pool/main/m/manpages/manpages_2.04.orig.tar.gz

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Martin Schulze <> (supplier of updated manpages package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing

Hash: SHA1

Format: 1.7
Date: Sun, 13 Nov 2005 06:55:01 +0100
Source: manpages
Binary: manpages manpages-dev
Architecture: source all
Version: 2.04-1
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <>
Changed-By: Martin Schulze <>
 manpages   - Manual pages about using a GNU/Linux system
 manpages-dev - Manual pages about using GNU/Linux for development
Closes: 194842 239424 263109 290880 296183 308359 309578 311680 311800 313607
 manpages (2.04-1) unstable; urgency=low
   * New upstream version
     - Includes updates nice(5) page (Closes: Bug#296183)
     - Fix description of return value in getopt(3) (Closes: Bug#308359)
     - Corrected example in hsearch(3) (Closes: Bug#313607)
     - Added reference to log1p(3) (Closes: Bug#309578)
     - Fix return value for makecontext(3) (Closes: Bug#311800)
     - Fix example in rand(3) (Closes: Bug#194842)
     - Corrections to realpath(3) (Closes: Bug#239424)
     - Corrected header in rcmd(3) (Closes: Bug#311680)
     - Corrected %p type in scanf(3) (Closes: Bug#263109)
     - Corrected info for standard filedes in stdin(3) (Close: Bug#295859)
     - Added missing header to strerror(3) (Closes: Bug#290880)
 cb010283c01f88d5984f94ff6fdce46a 584 doc - manpages_2.04-1.dsc
 86619809c53b5d8c6c6c82cb0aa8c4c8 1029542 doc - manpages_2.04.orig.tar.gz
 e31dc334b17d1b981142855dbd46a1a1 45665 doc - manpages_2.04-1.diff.gz
 633a73a4097ca44b14a12b79fa1f0207 398780 doc important manpages_2.04-1_all.deb
 988ac1a7816ccf2b4ed04b0642930179 1089660 doc standard manpages-dev_2.04-1_all.deb

Version: GnuPG v1.4.2 (GNU/Linux)


Bug archived. Request was from Debbugs Internal Request <> to (Tue, 26 Jun 2007 01:48:52 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.

Debian bug tracking system administrator <>. Last modified: Sat Apr 19 11:01:13 2014; Machine Name:

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.