Typo in the scanf documentation (man)
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
- Daniel Holbach (community): Approve
- Ubuntu branches: Pending requested
-
Diff: 26 lines (+7/-1)2 files modifieddebian/changelog (+6/-0)
man3/scanf.3 (+1/-1)
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 |
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.