kopia lustrzana https://github.com/espressif/esp-idf
docs: Update CN for gcc.rst
rodzic
d2d75efeff
commit
d2931274ba
|
@ -15,20 +15,20 @@ The previous GCC version was GCC 12.2.0. This has now been upgraded to GCC 13.2.
|
|||
Common Porting Problems and Fixes
|
||||
=================================
|
||||
|
||||
stdio.h No Longer Includes sys/types.h
|
||||
--------------------------------------
|
||||
``stdio.h`` No Longer Includes ``sys/types.h``
|
||||
-------------------------------------------------
|
||||
|
||||
Issue:
|
||||
Issue
|
||||
^^^^^^
|
||||
|
||||
Compile errors may occur in code that previously worked with the old toolchain. For example:
|
||||
Compilation errors may occur in code that previously worked with the old toolchain. For example:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <stdio.h>
|
||||
clock_t var; // error: expected specifier-qualifier-list before 'clock_t'
|
||||
|
||||
Solution:
|
||||
Solution
|
||||
^^^^^^^^^
|
||||
|
||||
To resolve this issue, the correct header must be included. Refactor the code like this:
|
||||
|
|
|
@ -10,3 +10,30 @@ GCC 版本
|
|||
ESP-IDF 之前使用的 GCC 版本为 12.2.0,现已针对所有芯片目标升级至 GCC 13.2.0。若需要将代码从 GCC 12.2.0 迁移到 GCC 13.2.0,请参考以下 GCC 官方迁移指南。
|
||||
|
||||
* `迁移至 GCC 13 <https://gcc.gnu.org/gcc-13/porting_to.html>`_
|
||||
|
||||
|
||||
常见迁移问题和解决方法
|
||||
=================================
|
||||
|
||||
``stdio.h`` 不再包含 ``sys/types.h``
|
||||
-------------------------------------------------
|
||||
|
||||
问题描述
|
||||
^^^^^^^^^^^^
|
||||
|
||||
使用旧工具链的代码可能会出现编译错误,例如:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <stdio.h>
|
||||
clock_t var; // error: expected specifier-qualifier-list before 'clock_t'
|
||||
|
||||
解决方法
|
||||
^^^^^^^^^^^^
|
||||
|
||||
使用正确的头文件可以解决这一问题。请按照以下方式重构代码:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <time.h>
|
||||
clock_t var;
|
||||
|
|
Ładowanie…
Reference in New Issue