mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-10 06:31:24 +00:00
Merge branch 'change/remove-sys_dirent_h-include' into 'master'
change(newlib): prepare dirent.h to remove Closes IDF-10675 and LLVM-330 See merge request espressif/esp-idf!41608
This commit is contained in:
@@ -93,6 +93,39 @@ Warn when an explicitly defaulted function is deleted by the compiler. That can
|
||||
C(const C&&) = default; /* Implicitly deleted. */
|
||||
};
|
||||
|
||||
``sys/dirent.h`` No Longer Includes Function Prototypes
|
||||
-------------------------------------------------------
|
||||
|
||||
Issue
|
||||
^^^^^^
|
||||
|
||||
Compilation errors may occur in code that previously worked with the old toolchain. For example:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <sys/dirent.h>
|
||||
/* .... */
|
||||
DIR* dir = opendir("test_dir");
|
||||
/* .... */
|
||||
/**
|
||||
* Compile error:
|
||||
* test.c: In function 'test_opendir':
|
||||
* test.c:100:16: error: implicit declaration of function 'opendir' [-Werror=implicit-function-declaration]
|
||||
* 100 | DIR* dir = opendir(path);
|
||||
* | ^~~~~~~
|
||||
*/
|
||||
|
||||
Solution
|
||||
^^^^^^^^^
|
||||
|
||||
To resolve this issue, the correct header must be included. Refactor the code like this:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <dirent.h>
|
||||
/* .... */
|
||||
DIR* dir = opendir("test_dir");
|
||||
|
||||
Picolibc
|
||||
--------
|
||||
|
||||
|
Reference in New Issue
Block a user