Bug 249723
Summary: | sscanf(str, "%as", &charptr) broken with --std=gnu99 | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Peter Jones <pjones> | ||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | low | ||||||
Version: | rawhide | Keywords: | Reopened | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2007-07-27 07:25:12 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Peter Jones
2007-07-26 17:31:04 UTC
Created attachment 160047 [details]
this is a fix.
That code is intentional, glibc violates the C99 standard by this. The upcoming POSIX standard will use m modified instead (so %ms, %mS, %mls, %m[) and glibc will soon implement it. ATM I have a few questions about the exact wording and unclear description of memory allocation failure handling case (which will be different from glibc's %as/%aS/%a[ modifier handling), once that's resolved we'll implement it in glibc and also in gcc format checking (the m modifier letter has been cleared with ISO groups already). Well, yeah, it's a gnu extension -- that's why --std is set to gnu99, not c99 or similar. The current behavior is directly contrary to the current documentation. But it is a GNU extension that violates the standard, -std=gnu99 generally enables extensions to the standard that don't conflict with the standard. The warning is still very useful to inform people about the extension conflict with the standard. When we implement the m modifier, the intent is for the strict modes to not accept %as, %aS and %a[ any longer (have a separate set of *scanf entrypoints for that mode) and people really should be aware of this. Hopefully they will switch to using %ms, %mS, %m[ soon to get rid of the warning, which is the intent. |