Bug 43287 - scanf documentation example
scanf documentation example
Status: RESOLVED INVALID
Product: Documentation
Classification: Unclassified
Component: man-pages
All Linux
: P1 normal
Assigned To: Michael Kerrisk
:
Depends on:
Blocks:
  Show dependency treegraph
 
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
Tree: Mainline
Regression: No


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.