Tue 20 Mar 2007 05:04:41 PM UTC, comment #4:
> Fix in docs or in source?
We don't have locales, so we should restrict the implementation
to just space and TAB. Note the emphasis on "separate words".
This is also justified by the C99 Rationale:
7.4.1.3 The isblank function
A new feature of C99: text processing applications often need to distinguish white space that can
occur within lines from white space that separates lines (for example, see §6.10 regarding use of
whitespace in the preprocessor). This distinction is also a property of POSIX locale definition
files.
|
Tue 20 Mar 2007 03:34:54 PM UTC, comment #3:
> isblank() is not the same as isspace().
Crap - i was misreading this:
"The isblank function tests for any character that is a standard blank character or is one of a locale-specific set of characters FOR WHICH ISSPACE IS TRUE and that is used to separate words within a line of text." (emphasis mine)
As saying it must return those for which isspace is true, not as the set of which isblank CAN return is limited to those isspace considers true.
Fix in docs or in source? Both are valid, the source does explicitly check for vertical tab but that was never documented...
Regards,
-Colin
|
Tue 20 Mar 2007 03:15:43 PM UTC, comment #1:
From the C99 Standard, section 7.4.1.6:
The isblank function tests for any character that is a standard blank character or is one of a locale-specific set of characters for which isspace is true and that is used to separate words within a line of text. The standard blank characters are the following: space (' '), and horizontal tab ('\t'). In the "C" locale, isblank returns true only for the standard blank characters.
Now section J.4:
J.4 Locale-specific behavior
1 The following characteristics of a hosted environment are locale-specific and are required
to be documented by the implementation:
....
— The sets of characters tested for by the isalpha, isblank, islower, ispunct ,
isspace, isupper, iswalpha, iswblank, iswlower, iswpunct ,
iswspace, or iswupper functions (7.4.1.2, 7.4.1.3, 7.4.1.7, 7.4.1.9, 7.4.1.10,
....
The avr-libc documentation says:
int isspace ( int __c )
Checks for white-space characters. For the avr-libc library, these are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
Not a bug - does conform to C99 standard. Suggest moderator closes bug.
Regards,
-Colin
|