[Fontconfig] How necessary is 'scandir'?
rs at mytum.de
Sun Feb 15 05:01:37 PST 2015
On 02/12/15 03:59, Akira TAGOH wrote:
> If the own scandir works on the platforms where don't have POSIX version
> of scandir, we could drop that check. if anyone confirm, that would be
The question is, for what cases would we need our own scandir. Because:
(1) On Win32, FcDirChecksum isn't used (we use
(2) On all platforms we supported before
38ab7ab2fbd83c0c62e4b78302b5fe89da0cb79e (where the configure check was
introduced), scandir *is* available. Either the POSIX one (in the sense
of ) which uses dirent comparators or the one that uses void* .
Because of that, we wouldn't need to specifically test for  and could
just assume it's there, avoiding clashes with UNIX compilers that can't
execute our test because of -Werror.
Now what about platforms where there is indeed neither
GetFileAttributesEx nor any version of scandir? I admit that these were
probably supported before 0ac6c98294d666762960824d39329459b22b48b7
(https://bugs.freedesktop.org/show_bug.cgi?id=25535) and aren't now. If
we wanted to support those, then yes, we would need to check for both
scandir versions, although the check for the POSIX variant could be a
simple fallback that doesn't need -Werror. And even then, we could
probably simply ignore the result of FcIsFsMtimeBroken as the change
addressed FAT file systems on UNIX/Linux only. I mean, the set of
UNIX/Linux systems that don't have scandir and at the same time use a
font directory on FAT is probably rather small...
> On Thu, Feb 12, 2015 at 7:55 AM, Raimund Steger <rs at mytum.de
> <mailto:rs at mytum.de>> wrote:
> On 02/11/15 19:40, Michael Felt wrote:
> Yes, xlC, and I was hoping it was just a stray gcc flag.
> If that's indeed the reason, you can:
> (0) To confirm whether it is, replace WERROR_CFLAGS="-Werror" with
> WERROR_CFLAGS="" in configure.ac <http://configure.ac>, run
> autoconf, configure etc.
> If that works:
> (1) find an equivalent flag for XL C and create a patch, just like
> the one for SunPRO . If I understand the documentation right ,
> this could be "-qmaxerr=1:w" (increase the number 1 if some
> 'statement not reached' stuff gets in your way), but it's difficult
> to say without an actual installation to test.
> (2) create a patch similar to (1), but set WERROR_CFLAGS="" or
> disable the scandir check altogether when compiling with XL C. I
> believe before  there wasn't even a scandir check, and the change
> was only to silence warnings on NetBSD if I read the commit right. I
> doubt you will have any problem on AIX.
> Actually I'm still somewhat unhappy that configure wants to
> acknowledge the POSIX version of scandir specially when only
> recognizing the NetBSD version would probably have sufficed ...
> would have saved us a lot of if's, maybe even the one for $os_win32.
> But I'll shut my mouth again.
> Akira TAGOH
Worringer Str 31 Duesseldorf 40211 DE home: <rs at mytum.de>
+49-179-2981632 icq 16845346 work: <rs at interface-ag.de>
More information about the Fontconfig