Skip to content

Commit 01fb905

Browse files
committed
newlib: Enable C99 format specifier support
This commit enables the C99 format specifier support for the newlib full variant since it is required for C99 standard compatibility. Without this, Zephyr applications cannot make use of the format specifiers newly added in the C99 standard such as `%hhu` and `%hhd`. Note that the C99 format specifier support is kept disabled for the newlib nano variant (i.e. `CT_LIBC_NEWLIB_NANO_IO_C99FMT=n`) because enabling it can lead to increased code size. This also aligns the Zephyr SDK's behaviour to that of the GNU Arm Embedded toolchain, which only enables the C99 format specifier support in the newlib full variant. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 1d129e0 commit 01fb905

19 files changed

+21
-0
lines changed

configs/arc.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1515
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1616
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1717
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
18+
CT_LIBC_NEWLIB_IO_C99FMT=y
1819
CT_LIBC_NEWLIB_IO_LL=y
1920
CT_LIBC_NEWLIB_IO_FLOAT=y
2021
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/arc64.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1717
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1818
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1919
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
20+
CT_LIBC_NEWLIB_IO_C99FMT=y
2021
CT_LIBC_NEWLIB_IO_LL=y
2122
CT_LIBC_NEWLIB_IO_FLOAT=y
2223
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/arm.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1515
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1616
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1717
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
18+
CT_LIBC_NEWLIB_IO_C99FMT=y
1819
CT_LIBC_NEWLIB_IO_LL=y
1920
CT_LIBC_NEWLIB_IO_FLOAT=y
2021
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/arm64.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1515
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1616
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1717
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
18+
CT_LIBC_NEWLIB_IO_C99FMT=y
1819
CT_LIBC_NEWLIB_IO_LL=y
1920
CT_LIBC_NEWLIB_IO_FLOAT=y
2021
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/i586.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1616
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1717
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1818
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
19+
CT_LIBC_NEWLIB_IO_C99FMT=y
1920
CT_LIBC_NEWLIB_IO_LL=y
2021
CT_LIBC_NEWLIB_IO_FLOAT=y
2122
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/iamcu.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1616
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1717
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1818
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
19+
CT_LIBC_NEWLIB_IO_C99FMT=y
1920
CT_LIBC_NEWLIB_IO_LL=y
2021
CT_LIBC_NEWLIB_IO_FLOAT=y
2122
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/mips.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1414
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1515
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1616
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
17+
CT_LIBC_NEWLIB_IO_C99FMT=y
1718
CT_LIBC_NEWLIB_IO_LL=y
1819
CT_LIBC_NEWLIB_IO_FLOAT=y
1920
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/nios2.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1515
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1616
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1717
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
18+
CT_LIBC_NEWLIB_IO_C99FMT=y
1819
CT_LIBC_NEWLIB_IO_LL=y
1920
CT_LIBC_NEWLIB_IO_FLOAT=y
2021
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/riscv64.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1717
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1818
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1919
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
20+
CT_LIBC_NEWLIB_IO_C99FMT=y
2021
CT_LIBC_NEWLIB_IO_LL=y
2122
CT_LIBC_NEWLIB_IO_FLOAT=y
2223
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

configs/sparc.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CT_NEWLIB_DEVEL_URL="https://github.com/zephyrproject-rtos/newlib-cygwin.git"
1414
CT_NEWLIB_DEVEL_REVISION="2893dbb10f1fe3bf431a26f89a22e12a5020dc02"
1515
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2"
1616
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
17+
CT_LIBC_NEWLIB_IO_C99FMT=y
1718
CT_LIBC_NEWLIB_IO_LL=y
1819
CT_LIBC_NEWLIB_IO_FLOAT=y
1920
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set

0 commit comments

Comments
 (0)