DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2204
Version: 1.3-current


In the continuing effort to protect us from errors we never make, GCC 4.4's
strings.h (or some deeply nested include therein) includes *two* flavors of
strchr():

const char* strchr(const char*, int); // and
char* strchr(char*, int);

(Because we can't have our programmers sneaking around and mucking about
in constant strings made vulnerable by a mere function call!)

Starting circa line 275 of fl_set_fonts_xft.cxx we have:

      stop = start = first = 0;
      stop = strchr((const char *)font, ',');  //** Here's first problem
      start = strchr((const char *)font, ':'); //** Here's second.
      if ((stop) && (start) && (stop < start))
      {
        first = stop + 1; // discard first version of name
        // find first comma *after* the end of the name
        stop = strchr((const char *)start, ','); //** Here's third.
      }

GCC 4.4 picks the more restrictive of the declarations and won't allow the
result of strchr() (a const char*) to be assigned into a vanilla char*.

The fix:

Replace the first two casts to "(char*)", and delete the second cast
entirely.


Link: http://www.fltk.org/str.php?L2204
Version: 1.3-current

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

Reply via email to