From 53b4806f0007aa2ae5829e405b50b84bdfb9734d Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Wed, 10 May 2023 16:38:30 +0800 Subject: [PATCH 1/2] doc: clarified migration guide regarding PRIxx usage --- docs/en/migration-guides/release-5.x/5.0/gcc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/migration-guides/release-5.x/5.0/gcc.rst b/docs/en/migration-guides/release-5.x/5.0/gcc.rst index bef17c2f44..eba08800a2 100644 --- a/docs/en/migration-guides/release-5.x/5.0/gcc.rst +++ b/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 ````. 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 ````. 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 ```` (e.g. ``int``) do *not* need this special formatting. In other cases, it should be noted that enums have the ``int`` type. From d7550703ce786611c1f663fe5562a362ef97612b Mon Sep 17 00:00:00 2001 From: Mo Fei Fei Date: Fri, 12 May 2023 15:02:00 +0800 Subject: [PATCH 2/2] Docs: Update CN translation for gcc.rst --- docs/en/migration-guides/release-5.x/5.0/gcc.rst | 2 +- docs/zh_CN/migration-guides/release-5.x/5.0/gcc.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/migration-guides/release-5.x/5.0/gcc.rst b/docs/en/migration-guides/release-5.x/5.0/gcc.rst index eba08800a2..c1f5f83ee0 100644 --- a/docs/en/migration-guides/release-5.x/5.0/gcc.rst +++ b/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 ````. 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 ```` (e.g. ``int``) do *not* need this special formatting. +The change mostly affects code that formats strings using types provided by ````. 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 ```` (e.g., ``int``) do *not* need this special formatting. In other cases, it should be noted that enums have the ``int`` type. diff --git a/docs/zh_CN/migration-guides/release-5.x/5.0/gcc.rst b/docs/zh_CN/migration-guides/release-5.x/5.0/gcc.rst index c8e712d918..d6d7d1630c 100644 --- a/docs/zh_CN/migration-guides/release-5.x/5.0/gcc.rst +++ b/docs/zh_CN/migration-guides/release-5.x/5.0/gcc.rst @@ -114,7 +114,7 @@ Xtensa 编译器中的 ``int32_t`` 和 ``uint32_t`` - (unsigned) long -上述变化主要影响到使用 ```` 提供的类型来格式化字符串的代码。请使用 ``PRIi32``、``PRIxx`` 等占位符来分别替换 ``%i``、``%x`` 等。 +若代码中使用了 ```` 提供的类型来格式化字符串,则这些代码会受到上述变化的影响。使用这些宽度固定的类型(例如 ``uint32_t``)时,请使用 ``PRIi32``、``PRIx32`` 来分别替换 ``%i``、``%x`` 等占位符。**只有** 在 ```` 中定义的类型(例如 ``int``)需要这种特殊格式。 在其他情况下,请注意枚举支持 ``int`` 类型。