fscanf problem in glibc shipped with latest F11 updates.
Jakub Jelinek
jakub at redhat.com
Mon Aug 31 14:10:10 UTC 2009
On Mon, Aug 31, 2009 at 04:45:17PM +0300, Maz The Northener wrote:
> I found out that after I updated my F11 a few days ago, fscanf started
> missbehaving.
>
> I filed a bug report in bugzilla. (bug 520414)
>
> but since I have not heard anyone else yelling about this, I thought
> that maybe this is my fault after all... Any suggestions how to verify
> this?
>
> (I do not need any help overcoming it, workaround is quite
> straightforward for me - remove GNU extension usage. I just would like
> to know if the bug is on my side.)
This is just a user error. You are not using any feature test macros
(see
info libc 'Feature Test Macros'
), and with that glibc headers when not using strict ISO C modes (-ansi,
-std=c89, -std=c99) default to _POSIX_C_SOURCE=200809L in recent glibcs,
which among other things mean XPG6 compliant *scanf. As %a is a POSIX
floating point in hex specifier, it conflicts with the GNU extension
where a if followed by s, S or [ is treated as allocatable modifier.
So, to make your code work either compile with -D_GNU_SOURCE, or, better,
just use POSIX 2008 way, %m[a-z].
Jakub
More information about the devel
mailing list