Bug 43287 - scanf documentation example
Summary: scanf documentation example
Status: RESOLVED INVALID
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Michael Kerrisk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-23 23:48 UTC by Berk Gökden
Modified: 2012-12-21 16:58 UTC (History)
1 user (show)

See Also:
Kernel Version: n/a
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Berk Gökden 2012-05-23 23:48:43 UTC
In scanf man file ( http://man7.org/linux/man-pages/man3/scanf.3.html ), in notes section an example given.
Example only works if it is compiled with -std=c89 option. It is not well defined. Probably because it was written long ago.
Comment 1 Michael Kerrisk 2012-12-21 16:58:31 UTC
The man page already explains this quite clearly though:

       The a modifier is not available if the program is compiled with
       gcc -std=c99 or gcc  -D_ISOC99_SOURCE  (unless  _GNU_SOURCE  is
       also specified), in which case the a is interpreted as a speci‐
       fier for floating-point numbers (see above).

So, closing this bug.

Thanks,

Michael

Note You need to log in before you can comment on or make changes to this bug.