FLTK logo

STR #2205

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 2.0 | SVN ⇄ GIT ]

STR #2205

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:filename_list.cxx:66: error: invalid conversion from 'int (*)(const void*, const void*)' to 'int (*)(const dirent64**, const dirent64**)'
Version:2.0-current
Created By:mnowak
Assigned To:AlbrechtS
Fix Version:2.0-current (SVN: v6834)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 AlbrechtS
07:17 Jul 21, 2009
scandir_posix.patch
2k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 mnowak
14:07 Jun 16, 2009
OS:    : Fedora 11
Version: 2.0.x-6786
GCC:     g++ (GCC) 4.4.0 20090506 (Red Hat 4.4.0-4)
         gcc-4.4.0-4.i586

[...]
Compiling FileInput.cxx...
Compiling filename_absolute.cxx...
Compiling filename_ext.cxx...
Compiling filename_isdir.cxx...
Compiling filename_list.cxx...
filename_list.cxx: In function 'int fltk::filename_list(const char*, dirent64***, int (*)(const dirent64* const*, const dirent64* const*))':
filename_list.cxx:66: error: invalid conversion from 'int (*)(const void*, const void*)' to 'int (*)(const dirent64**, const dirent64**)'
filename_list.cxx:66: error:   initializing argument 4 of 'int scandir64(const char*, dirent64***, int (*)(const dirent64*), int (*)(const dirent64**, const dirent64**))'
make[1]: *** [filename_list.o] Error 1
make: *** [all] Error 2


I guess it worked with gcc-4.3.2 from Fedora 10.
 
 
#2 mnowak
14:26 Jun 16, 2009
(More verbose output)

gcc -I.. -I../fltk/compat -O2 -Wall -Wunused  -fPIC -I/usr/include/freetype2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wno-non-virtual-dtor -c filename_list.cxx
filename_list.cxx: In function 'int fltk::filename_list(const char*, dirent64***, int (*)(const dirent64* const*, const dirent64* const*))':
filename_list.cxx:66: error: invalid conversion from 'int (*)(const void*, const void*)' to 'int (*)(const dirent64**, const dirent64**)'
filename_list.cxx:66: error:   initializing argument 4 of 'int scandir64(const char*, dirent64***, int (*)(const dirent64*), int (*)(const dirent64**, const dirent64**))'
make[1]: *** [filename_list.o] Error 1
make[1]: Leaving directory `/home/newman/rpmbuild/BUILD/fltk-2.0.x-r6786/src'
make: *** [all] Error 2
 
 
#3 engelsman
14:29 Jun 16, 2009
See also http://www.fltk.org/str.php?L2202  
 
#4 jue
00:12 Jun 17, 2009
The problem is not related to gcc, but to a change in glibc 2.10.

See this bug report:
http://sourceware.org/ml/glibc-bugs/2009-01/msg00109.html

and the relevant commit to glibc:
http://sources.redhat.com/git/?p=glibc.git;a=commit;h=eee6b1432794967d4272394dfe
d1e2b5cca4be39

Basic fix is trivial, change
int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
to
int n = scandir(d, list, 0, (int(*)(const dirent **,const dirent **))sort);
 
 
#5 mnowak
01:05 Jun 17, 2009
I believe F-11 has this patch, but the compiling fails anyway. But the trivial code change helped.  
 
#6 jue
07:09 Jun 17, 2009
You miss-understood that, the above commit is part of the regular release for glibc 2.10. WRT the bug-report all _older_ versions of glibc have wrong definitions of the related functions.

So the only clean solution for fltk is either have a #if GLIBC in the sources-files or some additions to the autoconf stuff.
 
 
#7 mnowak
08:12 Jun 17, 2009
Thanks for explanation, now it's clear. I patched Fedora's unofficial fltk2 packages to build successfully on F-11.  
 
#8 ianmacarthur
03:00 Jul 14, 2009
From the thread:

[fltk.general] glibc scandir change for POSIX compliance [was: Re: re-install question]

it is apparent that this problem afflicts fltk-1.x variants as well.

Also, STR #2202 seems to be the same problem.
 
 
#9 AlbrechtS
07:17 Jul 21, 2009
Please try the attached patch (scandir_posix.patch) and report, if this solves the problem.

http://www.fltk.org/strfiles/2205/scandir_posix.patch
 
 
#10 adrian7778
07:52 Jul 21, 2009
Hey, I was redirected from http://www.fltk.org/str.php?L2223.
I can confirm that attached patch solves mine problem.
 
 
#11 AlbrechtS
08:10 Jul 21, 2009
Thanks for confirmation !  
 
#12 AlbrechtS
16:08 Jul 23, 2009
Fixed in Subversion repository.

Tested on Fedora 11 successfully.

See also STR #2202 and STR #2223.
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.