Explorar o código

Merge branch 'doc/improve_prixx_doc' into 'master'

doc: clarified migration guide regarding PRIxx usage

Closes IDFGH-10042

See merge request espressif/esp-idf!23675
Jakob Hasse %!s(int64=2) %!d(string=hai) anos
pai
achega
6f7229975a

+ 1 - 1
docs/en/migration-guides/release-5.x/5.0/gcc.rst

@@ -114,7 +114,7 @@ The types ``int32_t`` and ``uint32_t`` have been changed from the previous ``int
      - (unsigned) long
 
 
-The change mostly affects code that formats strings using types provided by ``<inttypes.h>``. Users will need to replace placeholders such as ``%i`` and ``%x`` with ``PRIi32`` and ``PRIxx`` respectively.
+The change mostly affects code that formats strings using types provided by ``<inttypes.h>``. When using these fixed-width types (e.g., ``uint32_t``), users will need to replace placeholders such as ``%i`` and ``%x`` with ``PRIi32`` and ``PRIx32`` respectively. Types *not* defined in ``<inttypes.h>`` (e.g., ``int``) do *not* need this special formatting.
 
 In other cases, it should be noted that enums have the ``int`` type.
 

+ 1 - 1
docs/zh_CN/migration-guides/release-5.x/5.0/gcc.rst

@@ -114,7 +114,7 @@ Xtensa 编译器中的 ``int32_t`` 和 ``uint32_t``
      - (unsigned) long
 
 
-上述变化主要影响到使用 ``<inttypes.h>`` 提供的类型来格式化字符串的代码。请使用 ``PRIi32``、``PRIxx`` 等占位符来分别替换 ``%i``、``%x`` 等
+若代码中使用了 ``<inttypes.h>`` 提供的类型来格式化字符串,则这些代码会受到上述变化的影响。使用这些宽度固定的类型(例如 ``uint32_t``)时,请使用 ``PRIi32``、``PRIx32`` 来分别替换 ``%i``、``%x`` 等占位符。**只有** 在 ``<inttypes.h>`` 中定义的类型(例如 ``int``)需要这种特殊格式
 
 在其他情况下,请注意枚举支持 ``int`` 类型。