Hi all!
Several months ago I opened STR 2726 (Debug assertion failed window in fluid). 
The problem was in sign extension of character before calling isspace().
- if (!nostrip) while (isspace(*n)) n++;

MSDN tells: "When used with a debug CRT library, isspace will display a CRT 
assert if passed a parameter that is not EOF or in the range of 0 through 0xFF".

 Thus in order to avoid this assertion (in case of symbols within 128..255) we 
have to cast char to unsigned char or mask low eight bits of int value. 
Matthias did the job and fluid worked fine.
- if (!nostrip) while (isspace((unsigned char)*n)) n++;

 But last week I updated my FLTK and found out that in April Fabien changed it 
back (via cast to int), commited and this STR marked as closed.
- if (!nostrip) while (isspace((int) *n)) n++;

 Of course, at the moment the debug assert window appears again. I wrote my 
thoughts to Fabien, but I had no answer.

Guys, is there someone who can reopen the STR and restore right behavior of 
fluid? Or explain why it is impossible to do? It is not very important bug, but 
annoying one.

PS. For instance, Scott Meyers in his book Effective STL (Item 35) uses the 
same method - casting symbol to unsigned char before calling some character 
function.
- int Ic1 = tolower(static_cast<unsigned char>(c1));

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to