Compiling with newer glibc versions will not work as readdir_r is deprecated.
It will lead into this errors:
tinydir/tinydir.h:241:2: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
error = readdir_r(dir->_d, dir->_ep, &dir->_e);
^~~~~
tinydir/tinydir.h:377:2: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
if (readdir_r(dir->_d, dir->_ep, &dir->_e) != 0)
^~
It is recommended to use readdir instead of readdir_r and use external locking (e.g. implement a simple mutex) until a new POSIX version is release which requires readdir to be thread-safe.
See also the "Portability Note" of readdir_r in [2].
The OLA project encountered the same issue [0], for reasons why to use readdir instead of readdir_r see also [1].
Compiling with newer glibc versions will not work as readdir_r is deprecated. It will lead into this errors:
It is recommended to use readdir instead of readdir_r and use external locking (e.g. implement a simple mutex) until a new POSIX version is release which requires readdir to be thread-safe. See also the "Portability Note" of readdir_r in [2]. The OLA project encountered the same issue [0], for reasons why to use readdir instead of readdir_r see also [1].
Some references: [0] https://github.com/OpenLightingProject/ola/issues/1055 [1] https://womble.decadent.org.uk/readdir_r-advisory.html [2] https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html