Typo in the scanf documentation (man)

Bug #891854 reported by Zakhar
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
manpages (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Version used :
-------------------
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid

Observed behaviour:
-------------------
$ man scanf

There is a typo in the scanf documentation

In the section "Note", there is a code example.
The last instruction of this code example reads:

fprintf(stderr, "No matching characters\n"):

As is, the example won't compile.

Reproduce-able & How to reproduce:
-------------------
Yes & copy/paste the example in any text file, compile it (gcc), and observe.

Expected behaviour:
-------------------
The example should compile!

So if we write instead

fprintf(stderr, "No matching characters\n");

Basically, replace the : (colon) by a ; (semicolon) the example nows compiles.

Severity:
-------------
Minor...
Because any 'reasonably trained' C/C++ programmer should fix the bug by itself in a few seconds.
... but examples given in manual should work, shouldn't they?

Personal observation:
------------------
Although the example compiles once the correction done, the 'a' modifier seams to have a lot of constraints and is not 'standard'; whereas it is explained after the example that 'm' modifier will be Posix and have many more advantages.

Thus shouldn't the text about 'm' be before the example and the example be given with 'm' instead of 'a' as this seams the 'right' modifier to use (do people agree it is the best practice?) and 'a' looks sort of dangerous & deprecated.

Related branches

Revision history for this message
Zakhar (alainb06) wrote :

Sorry, I saw just now that there was a much easier way to report such bugs (eg typos in the man): send a mail to <email address hidden>

So that what I did just now, e-mail summarising this report and pointing to it (for details such as version used).

So basically "upstream" (? is it "upstream" for this) is already informed of this reports.

Best regards.

Colin Watson (cjwatson)
affects: man-db (Ubuntu) → manpages (Ubuntu)
Changed in manpages (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
status: Confirmed → Triaged
Changed in manpages (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Daniel Holbach (dholbach) wrote :

This seems to be fixed upstream in 3.36 upstream.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Uploaded, sitting in the review queue of the archive admins (Beta 1 Freeze).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package manpages - 3.32-0.2ubuntu2

---------------
manpages (3.32-0.2ubuntu2) precise; urgency=low

  * Fix typo in the scanf documentation: use ';' to terminate C code example
    line instead of ':'. Bug fixed upstream in 3.36. (LP: #891854)
 -- Soumyadeep Chanda <email address hidden> Sat, 25 Feb 2012 20:02:05 +0530

Changed in manpages (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.