bugAVR C Runtime Library - Bugs: bug #19281, isblank('\v') return TRUE:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #19281: isblank('\v') return TRUE: mismatch to C99

Submitter:  Dmitry Xmelkov <dmix>
Submitted:  Sun 11 Mar 2007 05:22:21 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  9 - Immediate Item Group:  None
Status:  Fixed Assigned to:  None
Percent Complete:  100% Open/Closed:  Closed
Release:  None Fixed Release:  None

Jump to the original submission

Fri 30 Mar 2007 12:21:26 PM UTC, comment #6: 

Fixed in CVS MAIN and 1.4 branches.

Dmitry Xmelkov <dmix>
Group administrator
Sun 25 Mar 2007 03:02:25 AM UTC, comment #5: 

Attached patch should fix it, just deletes the two lines...

I haven't tested it as my CVS checkout doesn't build properly, it errors out on the atoi.S file.

 -Colin

(file #12281)

Colin O Flynn <c_oflynn>
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.

Joerg Wunsch <joerg_wunsch>
Group administrator
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

Colin O Flynn <c_oflynn>
Tue 20 Mar 2007 03:20:30 PM UTC, comment #2: 


> Not a bug - does conform to C99 standard.


isblank() is not the same as isspace().

Joerg Wunsch <joerg_wunsch>
Group administrator
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

Colin O Flynn <c_oflynn>
Sun 11 Mar 2007 05:22:21 AM UTC, original submission:  

C99: The standard blank characters are the following: space (' '), and horizontal tab ('\t'): used to separate words within a line of text.

Dmitry Xmelkov <dmix>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #12281:  bug19281.diff added by c_oflynn (550B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arcanum (Updated the item)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by c_oflynn (Posted a comment)
  • -email is unavailable- added by dmix (Submitted the item)
  •  

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-07-01 dmix StatusNone Fixed
    2007-03-30 dmix Percent Complete0% 100%
        Open/ClosedOpen Closed
    2007-03-25 c_oflynn Attached File- Added bug19281.diff, #12281
    2007-03-25 arcanum Priority5 - Normal 9 - Immediate

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code