Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001163 [1003.1(2016)/Issue7+TC2] System Interfaces Editorial Error 2017-09-26 08:51 2019-01-31 16:25
Reporter Konrad_Schwarz View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Resolved  
Name Konrad Schwarz
Organization Siemens AG
User Reference
Section fscanf
Page Number 949
Line Number 32228
Interp Status ---
Final Accepted Text Note: 0004236
Summary 0001163: fscanf omits carriage in the list of white space character directives
Description fscanf lists the white space characters it skips when encountering a blank:

Each directive is composed of one of the following: one or more white-space characters ( <space>, <tab>, <newline>, <vertical-tab>, or <form-feed>);

This list does not include carriage-return. I think this is an omission.

The equivalent text in ISO/IEC 9899:2011 (E) (C9x) is

The format is composed of zero or more directives: one or more white-space
characters,

Desired Action Add carriage-return to the list of white-space characters.

It is not clear to me if this list is locale-dependent -- making
this locale-dependent would allow the meaning of format strings to
be manipulated externally, which conceivably may pose a security risk.
Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0003855)
geoffclare (manager)
2017-09-26 09:40

The fwscanf page has the same problem.
(0004231)
nick (manager)
2019-01-28 16:44

This is a mirror of ISO C DR 497 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_497). [^] This bug should be resolved in the same way as that DR, and so is held open pending resolution by WG14.
(0004235)
dennisw (reporter)
2019-01-28 20:44

The link in Note: 0004231 seems to point to an outdated version of the WG14 defect report log.
DR 497 has already been resolved in the latest version at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2316.htm#dr_497 [^]
(0004236)
geoffclare (manager)
2019-01-29 17:25

I believe the following changes match the changes adopted by the C committee in DR 497 (at the link given in note Note: 0004235), and fix related problems where we use "character" but should use "byte" (because the C standard says "character" not "multibyte character"). There are also some changes to strptime() for consistency.

On page 104 line 2874 section XBD 3.442 White Space, change:
defined via the LC_CTYPE category in the current locale
to:
defined via the LC_CTYPE category in the current locale or a specified locale

On page 104 line 2877 section XBD 3 Definitions, add three new definitions:
3.443 White-Space Byte

A single-byte white-space character; that is, a character for which the isspace() or isspace_l() function returns a non-zero value.

3.444 White-Space Character

A character that belongs to the space character class as defined via the LC_CTYPE category in the current locale or a specified locale.

3.445 White-Space Wide Character

A wide-character code that belongs to the space character class as defined via the LC_CTYPE category in the current locale or a specified locale.

On page 949 line 32229 section fscanf(), change:
white-space characters (<space>, <tab>, <newline>, <vertical-tab>, or <form-feed>)
to:
white-space bytes

On page 949 line 32230 section fscanf(), and
on page 2063 line 66111 section strptime(), change:
nor a white-space character
to:
nor a white-space byte

On page 950 line 32242 section fscanf(), and
on page 952 line 32334,32350 section fscanf(), and
on page 953 line 32378,32415 section fscanf(), and
on page 2081 line 66789 section strtol(), and
on page 2086 line 66903 section strtoul(), change:
white-space characters
to:
white-space bytes

On page 950 line 32243 section fscanf(), change:
first byte which is not a white-space character
to:
first non-white-space byte

On page 950 line 32253 section fscanf(), and
on page 2063 line 66110 section strptime(), and
on page 2072 line 66458 section strtod(), and
on page 2081 line 66769 section strtol(), and
on page 2086 line 66882 section strtoul(), change:
white-space characters (as specified by isspace())
to:
white-space bytes

On page 954 line 32422 section fscanf(), change:
white space
to:
white-space bytes

On page 1003 line 34130 section fwscanf(), change:
white-space wide characters (<space>, <tab>, <newline>, <vertical-tab>, or <form-feed>)
to:
white-space wide characters

On page 1003 line 34132 section fwscanf(), change:
white-space character
to:
white-space wide character

On page 1004 line 34158 section fwscanf(), change:
white-space wide characters (as specified by iswspace())
to:
white-space wide characters

On page 1007 line 34321 section fwscanf(), change:
other than leading white-space
to:
other than leading white-space wide characters

On page 1008 line 34328 section fwscanf(), change:
white space
to:
white-space wide characters

On page 2063 line 66124 section strptime(), change:
there is white-space or other non-alphanumeric characters
to:
there are white-space bytes or other non-alphanumeric bytes

On page 2064 line 66159,66166 section strptime(), change:
white space
to:
white-space bytes

On page 2065 line 66213 section strptime(), change:
A conversion specification composed of white-space characters is executed by scanning input up to the first character that is not white-space (which remains unscanned)
to:
A conversion specification composed of white-space bytes is executed by scanning input up to the first non-white-space byte (which remains unscanned)

On page 2065 line 66220 section strptime(), change:
A series of conversion specifications composed of %n, %t, white-space characters, or any combination is executed by scanning up to the first character that is not white space (which remains unscanned)
to:
A series of conversion specifications composed of %n, %t, white-space bytes, or any combination is executed by scanning up to the first non-white-space byte (which remains unscanned)

On page 2072 line 66482 section strtod(), and
on page 2081 line 66790 section strtol(), and
on page 2086 line 66904 section strtoul(), change:
non-white-space character
to:
non-white-space byte

On page 2081 line 66788 section strtol(), and
on page 2086 line 66901 section strtoul(), change:
initial subsequence of the input string, starting with the first non-white-space character that is of the expected form
to:
initial subsequence of the input string, starting with the first non-white-space byte, that is of the expected form

On page 2270 line 72239 section wcstod(), and
on page 2277 line 72468 section wcstol(), change:
on page 2284 line 72632 section wcstoul(), change:
white-space wide-character codes (as specified by iswspace())
to:
white-space wide characters

On page 2277 line 72488 section wcstol(), change:
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide-character code that is of the expected form. The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character code, or if the first non-white-space wide-character code is other than a sign or a permissible letter or digit.
to:
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide character, that is of the expected form. The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide characters, or if the first non-white-space wide character is other than a sign or a permissible letter or digit.

On page 2284 line 72652 section wcstoul(), change:
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first wide-character code that is not white space and is of the expected form. The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character codes, or if the first wide-character code that is not white space is other than a sign or a permissible letter or digit.
to:
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide character, that is of the expected form. The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide characters, or if the first non-white-space wide character is other than a sign or a permissible letter or digit.

- Issue History
Date Modified Username Field Change
2017-09-26 08:51 Konrad_Schwarz New Issue
2017-09-26 08:51 Konrad_Schwarz Name => Konrad Schwarz
2017-09-26 08:51 Konrad_Schwarz Organization => Siemens AG
2017-09-26 08:51 Konrad_Schwarz Section => fscanf
2017-09-26 08:51 Konrad_Schwarz Page Number => (page or range of pages)
2017-09-26 08:51 Konrad_Schwarz Line Number => (Line or range of lines)
2017-09-26 09:40 geoffclare Note Added: 0003855
2019-01-28 16:32 nick Page Number (page or range of pages) => 949
2019-01-28 16:32 nick Line Number (Line or range of lines) => 32228
2019-01-28 16:32 nick Interp Status => ---
2019-01-28 16:44 nick Note Added: 0004231
2019-01-28 20:44 dennisw Note Added: 0004235
2019-01-29 17:25 geoffclare Note Added: 0004236
2019-01-31 16:25 geoffclare Final Accepted Text => Note: 0004236
2019-01-31 16:25 geoffclare Status New => Resolved
2019-01-31 16:25 geoffclare Resolution Open => Accepted As Marked
2019-01-31 16:25 geoffclare Tag Attached: tc3-2008


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker