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 * Updated the fs_shell version of DoublyLinkedList.h to contain the latest 2008-07-31 11:21:47 +00:00
fssh_api_wrapper.h Remove B_FILE_NOT_FOUND from public headers. 2021-10-19 15:58:54 +00:00
fssh_atomic.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
fssh_auto_deleter.h Build fix. 2020-12-10 18:01:22 +01:00
fssh_auto_locker.h * Replaced most of the error enums with #defines. 2008-07-07 18:10:21 +00:00
fssh_byte_order.h Missing prefix. 2008-05-29 20:51:59 +00:00
fssh_defs.h Added new [FSSH]_B_HAIKU_{32,64}_BIT macros. 2009-11-25 21:21:58 +00:00
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 * Added a flag B_DISK_SYSTEM_SUPPORTS_WRITING to determine whether or not a 2008-10-13 22:32:27 +00:00
fssh_disk_device_manager.h Added scan_partition() function which can be used by disk systems (e.g. 2007-10-04 18:03:24 +00:00
fssh_driver_settings.h libroot: remove delete_driver_settings 2021-05-31 06:51:45 +00:00
fssh_drivers.h trim: Target SCSI UNMAP command instead of WRITE SAME. 2013-11-07 19:03:47 +01:00
fssh_errno.h Provide a way to convert FS shell error codes to host platform error 2007-04-28 23:40:04 +00:00
fssh_errors.h Remove B_FILE_NOT_FOUND from public headers. 2021-10-19 15:58:54 +00:00
fssh_fcntl.h * Removed the O_* modes that we currently don't and probably won't support 2009-11-26 14:17:46 +00:00
fssh_fs_attr.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
fssh_fs_cache.h block_cache: Change signature of *_etc() functions 2020-06-20 18:10:03 +00:00
fssh_fs_index.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
fssh_fs_info.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
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 s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
fssh_fs_volume.h Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00
fssh_kernel_export.h * Explained under which circumstances vnode_path_to_vnode() will clobber the 2008-03-09 13:43:38 +00:00
fssh_kernel_priv.h Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00
fssh_lock.h Added recursive_lock_transfer_lock() to the fs_shell. 2012-03-31 00:09:47 +02:00
fssh_module.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
fssh_node_monitor.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
fssh_os.h fs_shell: Change {set_}real_time_clock to match the new definitions. 2017-11-21 15:18:11 +01:00
fssh_stat.h fs_shell: Added socket filetype. 2017-12-10 11:02:59 -05:00
fssh_stdio.h Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00
fssh_string.h Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00
fssh_time.h fixed btrfs_shell 2019-10-08 18:57:27 +02:00
fssh_type_constants.h Move B_MIME_STRING_TYPE to <TypeConstants.h> 2011-11-25 06:19:24 +01:00
fssh_types.h Introduced types [__haiku_]generic_{addr,size}_t which are wide enough for 2010-06-02 18:22:38 +00:00
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 Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00
KPath.h Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00
SinglyLinkedList.h * Minor cleanup. 2008-08-01 09:57:14 +00:00
Stack.h Beginnings of a new, better portable FS shell with Haiku FS interface. 2007-04-27 12:17:22 +00:00