DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2441
Version: 1.3-current
The function strchr returns a pointer into the string provided, so the
result type should have the same type as the provided string.
Current compilers deliver the function strchr in 2 versions. One that
takes on a const string and returns a const pointer and one that takes a
normal pointer and also returns a normal pointer.
In fluid file Fl_Function_Type.cxx you mix box types. You provide a const
string and assume a non const return type. This is wrong and will result
in an compilation error on recent glibc versions that provide the proper
prototypes.
Appended patch fixes the problem by also making the returned string const.
Link: http://www.fltk.org/str.php?L2441
Version: 1.3-current
Index: fluid/Fl_Function_Type.cxx
===================================================================
--- fluid/Fl_Function_Type.cxx (revision 7823)
+++ fluid/Fl_Function_Type.cxx (working copy)
@@ -471,7 +471,7 @@
void Fl_Code_Type::write_code1() {
const char* c = name();
if (!c) return;
- char *pch;
+ const char *pch;
const char *ind = indent();
while( (pch=strchr(c,'\n')) )
{
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs