Bug 623119 - __isoc99_sscanf is used regardless of -std option
__isoc99_sscanf is used regardless of -std option
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Andreas Schwab
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-11 07:42 EDT by Stas Sergeev
Modified: 2017-10-09 09:48 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-11 08:09:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stas Sergeev 2010-08-11 07:42:20 EDT
Description of problem:
All my programs have suddenly started to use
__isoc99_sscanf@@GLIBC_2.7, making it impossible
to run them on an older systems without recompiling.
The changelog of glibc says:
Redirect to __isoc99_* if strict ISO C99 or POSIX
	conformance requested.
But how to "unrequest" that strict conformance,
other than by defining _GNU_SOURCE? -std=gnu89
doesn't help.

Version-Release number of selected component (if applicable):
glibc-2.12-3.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Compile program with sscanf
2. Try to run it on another system with glibc <2.7
  
Actual results:
/lib/libc.so.6: version `GLIBC_2.7' not found

Expected results:
Program works

Additional info:
Comment 1 Jakub Jelinek 2010-08-11 08:09:36 EDT
glibc never pretended to be forward compatible, so if you want to run on system with older glibc, you should compile/link against the oldest glibc you want to support.

To use the non-standard version of sscanf, you need -D_GNU_SOURCE, or e.g. -D_POSIX_C_SOURCE=199506L, as POSIX 2008 mode is now the default.
Comment 2 Stas Sergeev 2010-08-11 08:28:03 EDT
Yes, I understand the forward-compat is
never guaranteed, but is the use of
__isoc99_sscanf really intentional when
-std=gnu89 is used?
Comment 3 Jakub Jelinek 2010-08-11 08:40:20 EDT
Yes.  -std=gnu89 doesn't have very big influence on the content of glibc headers, all it means is that __STRICT_ANSI__ isn't defined.  The Feature Test Macros is what matters.  And, in case of *scanf, it is actually better if the %ac/%as/%a[ GNU extensions are never used any more, and %mc/%ms/%m[ is used instead.  So, the more __isoc99_*scanf is used, the better.

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