Skip to content

Conversation

@pabigot
Copy link
Contributor

@pabigot pabigot commented Jan 6, 2021

Commits extracted from ongoing work in #30675 and #31102 that are independent of packed formatting.

Replace SANITYCHECK flag with TWISTER.

Signed-off-by: Peter Bigot <[email protected]>
TC_PRINTF doesn't append a newline, so the skip messages sometimes ran
into the test result message.

Signed-off-by: Peter Bigot <[email protected]>
checkpatch wants parameters to IS_ENABLED() to be Kconfig constants,
i.e. ones that start with CONFIG_.  Avoid the whinage.

Signed-off-by: Peter Bigot <[email protected]>
Providing a literal width or precision that exceeds the non-negative
range of int does not appear to be rejected by the standard, but it
does produce a build diagnostic so we can't test it.  Switch to an
equivalent form that doesn't affect line coverage.

Signed-off-by: Peter Bigot <[email protected]>
This function was designed to support the logging infrastructure's
need to copy values from va_list structures.  It did not meet that
need, since some values need to be changed based on additional data
that is only available when the complete format specification is
examined.  Remove the function as unnecessary.

Signed-off-by: Peter Bigot <[email protected]>
It may not be clear that the length modifiers reference native C types
with specific ranks.  Document the core type for each modifier.

Signed-off-by: Peter Bigot <[email protected]>
Whether char is signed or unsigned is toolchain and target specific.
Rather than assume it's signed (which is true for x86, but not for
ARM), do the right thing based on whether the minimum representable
value is less than zero.

Signed-off-by: Peter Bigot <[email protected]>
@pabigot pabigot requested a review from nordic-krch January 6, 2021 18:00
@github-actions github-actions bot added area: API Changes to public APIs area: Tests Issues related to a particular existing or missing test labels Jan 6, 2021
@pabigot pabigot force-pushed the nordic/20210106c branch 2 times, most recently from 2083477 to 9279aff Compare January 6, 2021 23:34
The l length modifier can apply to the c format specifier; in that
case the expected value is of type wint_t.  Minimal libc doesn't
define wint_t, and it is complex to do so correctly (must add
<wchar.h>, and use a lot of conditional tricks).

wint_t can differ from wchar_t in rank when wchar_t undergoes default
integral promotion, which it does on xtensa (wchar_t is unsigned
short).  So we can use wchar_t as an approximation, except in va_arg
where we need to use a wider type: int covers this case.

Note that we still don't format wide characters, but we do want to
consume the correct amount of data for a default-promoted extended
character.

Signed-off-by: Peter Bigot <[email protected]>
@nashif nashif requested a review from npitre January 7, 2021 04:07
@carlescufi carlescufi merged commit 6297c66 into zephyrproject-rtos:master Jan 7, 2021
@pabigot pabigot deleted the nordic/20210106c branch January 11, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants