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

[STR New]

Link: http://www.fltk.org/str.php?L2202
Version: 2.0-current


filename_cxx doesn't compile on Linux due incorrect scandir usage.
Current code (doesn't compile):
  int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
Correct code (compiles):
  int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent
**))sort);

Compile: gcc-4.3.3 on 64bit Gentoo Linux. The patch is attached.
Both 1.9 and 2.x versions are affected. I didn't check it for earlier FLTK
versions. The problem seems to be connected to latest GCC changes.


Link: http://www.fltk.org/str.php?L2202
Version: 2.0-current
diff -uNr fltk-2.0.x-r6786.orig/src/filename_list.cxx 
fltk-2.0.x-r6786/src/filename_list.cxx
--- fltk-2.0.x-r6786.orig/src/filename_list.cxx 2007-06-01 23:13:08.000000000 
+1000
+++ fltk-2.0.x-r6786/src/filename_list.cxx      2009-06-02 08:23:36.416690911 
+1000
@@ -62,8 +62,10 @@
   // This version is when we define our own scandir (WIN32 and perhaps
   // some Unix systems):
   int n = scandir(d, list, 0, sort);
-#elif defined(__linux) || defined (__FreeBSD__) || defined (__NetBSD__)
+#elif defined (__FreeBSD__) || defined (__NetBSD__)
   int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
+#elif defined(__linux)
+  int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
 #elif defined(__hpux) || defined(__CYGWIN__)
   // HP-UX, Cygwin define the comparison function like this:
   int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to