nuttx-apps/examples/userfs
Xiang Xiao 326b68aa36 examples/userfs: use designated initializers for struct dirent
The g_rootdir[] table initialized each entry's struct dirent member
positionally as { DTYPE_FILE, "FileN" }, which assumes d_type is the
first field.  This breaks when struct dirent gains the POSIX d_ino field
as its first member (see apache/nuttx: "fs/dirent: add d_ino member to
struct dirent"): the file-name string would be assigned to d_type,
producing -Wint-conversion warnings and an "initializer element is not
computable at load time" error.

Use designated initializers (.d_type / .d_name) so the table is robust
against the field order of struct dirent.

Also fix a 'Initiallly' typo in a nearby comment flagged by codespell.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-22 10:20:43 -03:00
..
CMakeLists.txt examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Kconfig examples: Add depends to different test cases 2025-03-06 09:34:24 +01:00
Make.defs examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
userfs_main.c examples/userfs: use designated initializers for struct dirent 2026-06-22 10:20:43 -03:00