https://bugzilla.novell.com/show_bug.cgi?id=704755 https://bugzilla.novell.com/show_bug.cgi?id=704755#c0 Summary: fscanf is not compliant to ISO C Classification: openSUSE Product: openSUSE 11.4 Version: Final Platform: x86-64 OS/Version: openSUSE 11.4 Status: NEW Severity: Normal Priority: P5 - None Component: Documentation AssignedTo: ke@novell.com ReportedBy: giecrilj@stegny.2a.pl QAContact: ke@novell.com Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 The LIBC manual, as distributed with glibc-info, makes the following statements that may not be true at the same time: Reproducible: Always Steps to Reproduce: 1. libc.info, 12.14.5: String Input Conversions 2. man regexp(7) 3. libc.info, Appendix B: Summary of Library Facilities 4. ISO/IEC 9899:TC3, 7.19.6.2: The fscanf function: 5: man fscanf(3) Actual Results: 1. You specify the set between the `[' character and a following `]' character, using the same syntax used in regular expressions. 2. Within a bracket expression, the name of a character class enclosed in "[:" and ":]" stands for the list of all characters belonging to that class. 3. `int fscanf (FILE *STREAM, const char *TEMPLATE, ...)' `stdio.h' (ISO): Formatted Input Functions. [That means fscanf conforms to ISO C standard, which it does not.] 4. The conversion specifier includes all subsequent characters in the format string, up to and including the matching right bracket (]). The characters between the brackets (the scanlist) compose the scanset, unless the character after the left bracket is a circumflex (^), in which case the scanset contains all characters that do not appear in the scanlist between the circumflex and the right bracket. If the conversion specifier begins with [] or [^], the right bracket character is in the scanlist and the next following right bracket character is the matching right bracket that ends the specification; otherwise the first following right bracket character is the one that ends the specification. 5. The set is defined by the characters between the open bracket [ character and a close bracket ] character. The set excludes those characters if the first character after the open bracket is a circumflex (^). To include a close bracket in the set, make it the first character after the open bracket or the circumflex; any other position will end the set. [This is in line with the ISO standard.] Expected Results: 1, This behavior should be explicitly documented as an incompatible extension. 3. If there is a standard that prescribes this behavior, it should be mentioned instead of ISO. 5. The manual page should reflect what the specifier actually means to the current implementation. Consider the following conversion specifier: scanf("%[[:alpha:]]", …); According to GNU: it matches "A" and it does not match ":]", even when compiled with -ansi. According to ISO: it does not match "A" but it matches ":]". -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.