Bug 11882 - Should headers default to strict ISO C99?
Summary: Should headers default to strict ISO C99?
Status: RESOLVED WORKSFORME
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.12
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 18:15 UTC by Carlos O'Donell
Modified: 2014-06-30 17:24 UTC (History)
1 user (show)

See Also:
Host: arm-none-linux-gnueabi
Target: arm-none-linux-gnueabi
Build: arm-none-linux-gnueabi
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos O'Donell 2010-08-04 18:15:18 UTC
The following commit:
http://sourceware.org/git/?p=glibc.git;a=commit;h=3e6b0a28ebc2319262b318790019558f78249c8b
updates the include/features.h headers to default _POSIX_C_SOURCE to 200809L,
this in turn defines __USE_ISOC99 to 1, and this causes the headers to trigger
strict ISO C99 mode which redirects sscanf to __isoc99_sscanf.

Applications that were previously using the sscanf format specifier '%a' (a GNU
extension) stop working. Using -std=gnu89, -std=gnu99 does not allow you to get
back the previous behaviour. Using -std=c89 or -D_GNU_SOURCE restores the
previous behaviour of supporting '%a' (now '%m' in POSIX).

The compiler is still defaulting to -std=gnu89.

Is it glibc's intent to default to strict ISO C99 mode?
Comment 1 Ulrich Drepper 2010-08-04 18:17:23 UTC
(In reply to comment #0)
> Is it glibc's intent to default to strict ISO C99 mode?

It always has been.  If you use GNU extension you have to use _GNU_SOURCE.
Comment 2 Carlos O'Donell 2010-08-04 18:26:47 UTC
Thanks Ulrich.