Skip to content

Use of deprecated function readdir_r on MacOS #349

@jll63

Description

@jll63

While compiling OpenMethod in CI for MacOS, using the boost-ci reusable workflow, I get:

[...]
2026-04-21T12:55:25.1862560Z Image: macos-26-arm64
2026-04-21T12:55:25.1863520Z Version: 20260413.0345.1
[...]
2026-04-21T12:58:41.9431590Z clang-darwin.compile.c++ bin.v2/libs/filesystem/build/clang-darwin-20/debug/arm_64/cxxstd-17-iso/threading-multi/visibility-hidden/directory.o
2026-04-21T12:58:41.9533840Z /Users/runner/work/openmethod/boost-root/libs/filesystem/src/directory.cpp:354:14: error: 'readdir_r' is deprecated: This function cannot be used safely as it does not take into account the variability of {NAME_MAX}.  It is highly recommended that you use readdir(3) instead. [-Werror,-Wdeprecated-declarations]
2026-04-21T12:58:41.9635680Z   354 |     return ::readdir_r
2026-04-21T12:58:41.9737190Z       |              ^
2026-04-21T12:58:41.9838990Z /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/dirent.h:114:1: note: 'readdir_r' has been explicitly marked deprecated here
2026-04-21T12:58:41.9940910Z   114 | __deprecated_msg("This function cannot be used safely as it does not take into account the variability of {NAME_MAX}.  It is highly recommended that you use readdir(3) instead.")
2026-04-21T12:58:42.0042310Z       | ^
2026-04-21T12:58:42.0142990Z /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:227:48: note: expanded from macro '__deprecated_msg'
2026-04-21T12:58:42.0243920Z   227 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
2026-04-21T12:58:42.0345230Z       |                                                       ^
2026-04-21T12:58:42.0447160Z 1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions