7db2616c44
GCC 11 treats [1] as a fixed-length array and not a flexible-length array, and so some things that used direct strcmp("..", ent->d_name), for instance, would be optimized out as being always unequal, which was the cause of #17389. Using a real FLA informs GCC that there is going to be more than one byte of data, and thus this fixes that bug. BeOS used [1] and not [0], possibly because it had to deal with compilers (MetroWerks? Early GCC2?) that did not support FLAs. GCC 2.95 does, using [0], and GCC 4 does, using [], so we can go with that here. (I did try using [0] for both, which seems to be OK with GCC 11, but GCC 8 throws errors when d_name is dereferenced directly as being-out-of-bounds. So, we have to use the #if here and give newer GCC the [] syntax and not [0] to avoid that problem.) The real question probably is whether or not we should backport some variant of these changes to R1/beta3, as software at HaikuPorts very well may run in to the same issue. (The alternative workaround is to compile with -O1 and not -O2 for any affected software.) But maybe this is an argument for keeping with the beta4 schedule of this coming January... |
||
---|---|---|
.. | ||
arch | ||
arpa | ||
compat/sys | ||
net | ||
netinet | ||
netinet6 | ||
sys | ||
alloca.h | ||
assert.h | ||
bsd_mem.h | ||
complex.h | ||
ctype.h | ||
dirent.h | ||
div_t.h | ||
dlfcn.h | ||
endian.h | ||
errno.h | ||
fcntl.h | ||
fenv.h | ||
fnmatch.h | ||
fts.h | ||
ftw.h | ||
getopt.h | ||
glob.h | ||
grp.h | ||
inttypes.h | ||
iovec.h | ||
langinfo.h | ||
libgen.h | ||
libio.h | ||
limits.h | ||
locale.h | ||
malloc_debug.h | ||
malloc.h | ||
math.h | ||
memory.h | ||
monetary.h | ||
netdb.h | ||
nl_types.h | ||
null.h | ||
poll.h | ||
pthread.h | ||
pwd.h | ||
regex.h | ||
resolv.h | ||
sched.h | ||
search.h | ||
semaphore.h | ||
setjmp.h | ||
shadow.h | ||
signal.h | ||
size_t.h | ||
spawn.h | ||
stdc-predef.h | ||
stdint.h | ||
stdio_ext.h | ||
stdio_post.h | ||
stdio_pre.h | ||
stdio.h | ||
stdlib.h | ||
string.h | ||
strings.h | ||
syslog.h | ||
tar.h | ||
termios.h | ||
time.h | ||
uchar.h | ||
unistd.h | ||
utime.h | ||
utmpx.h | ||
wchar_t.h | ||
wchar.h | ||
wctype.h |