Bug 43287

Summary: scanf documentation example
Product: Documentation Reporter: Berk Gökden (berkgokden)
Component: man-pagesAssignee: Michael Kerrisk (mtk.manpages)
Status: RESOLVED INVALID    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: n/a Subsystem:
Regression: No Bisected commit-id:

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