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

 
 

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

Submitted by:  Dmitry Xmelkov <dmix>
Submitted on:  Sun 11 Mar 2007 05:22:21 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 9 - ImmediateItem Group: None
Status: FixedPercent Complete: 100%
Assigned to: NoneOpen/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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>
Project 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>
Project 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>
Project 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>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by c_oflynn (Posted a comment)
  • -unavailable- added by dmix (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 01 Jul 2007 02:09:53 AM UTCdmixStatusNone=>Fixed
    Fri 30 Mar 2007 12:21:26 PM UTCdmixPercent Complete0%=>100%
      Open/ClosedOpen=>Closed
    Sun 25 Mar 2007 03:02:25 AM UTCc_oflynnAttached File-=>Added bug19281.diff, #12281
    Sun 25 Mar 2007 12:58:33 AM UTCarcanumPriority5 - Normal=>9 - Immediate

    Back to the top


    Powered by Savane 3.1-cleanup1