haiku/headers/private/fs_shell
Augustin Cavalier 7db2616c44 dirent: Use an actual flexible-length array for d_name.
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...
2021-11-18 16:34:03 -05:00
..
DoublyLinkedList.h
fssh_api_wrapper.h Remove B_FILE_NOT_FOUND from public headers. 2021-10-19 15:58:54 +00:00
fssh_atomic.h
fssh_auto_deleter.h Build fix. 2020-12-10 18:01:22 +01:00
fssh_auto_locker.h
fssh_byte_order.h
fssh_defs.h
fssh_dirent.h dirent: Use an actual flexible-length array for d_name. 2021-11-18 16:34:03 -05:00
fssh_disk_device_defs.h
fssh_disk_device_manager.h
fssh_driver_settings.h libroot: remove delete_driver_settings 2021-05-31 06:51:45 +00:00
fssh_drivers.h
fssh_errno.h
fssh_errors.h Remove B_FILE_NOT_FOUND from public headers. 2021-10-19 15:58:54 +00:00
fssh_fcntl.h
fssh_fs_attr.h
fssh_fs_cache.h block_cache: Change signature of *_etc() functions 2020-06-20 18:10:03 +00:00
fssh_fs_index.h
fssh_fs_info.h
fssh_fs_interface.h vfs: functions to change a vnode busy status and ID 2019-02-19 18:44:43 +00:00
fssh_fs_query.h
fssh_fs_volume.h
fssh_kernel_export.h
fssh_kernel_priv.h
fssh_lock.h
fssh_module.h
fssh_node_monitor.h
fssh_os.h
fssh_stat.h
fssh_stdio.h
fssh_string.h
fssh_time.h fixed btrfs_shell 2019-10-08 18:57:27 +02:00
fssh_type_constants.h
fssh_types.h
fssh_uio.h POSIX: make readv() and writev() conform to IEEE Std 1003.1-2001 2021-03-16 12:03:02 +00:00
fssh_unistd.h
KPath.h
SinglyLinkedList.h
Stack.h