Skip to content

Conversation

@DanTGL
Copy link
Contributor

@DanTGL DanTGL commented Mar 23, 2025

The signedness of the variable caused undefined behavior because the sign bit is modified when it gets left-shifted.

This fixes that by changing it to an unsigned variable.

@zephyrbot zephyrbot added size: XS A PR changing only a single line of code area: POSIX POSIX API Library labels Mar 23, 2025
@zephyrbot zephyrbot requested review from cfriedt and ycsin March 23, 2025 18:59
@DanTGL
Copy link
Contributor Author

DanTGL commented Mar 23, 2025

Seems like qemu_cortex_m0/nrf51822 doesn't have enough RAM for the integration tests

@cfriedt
Copy link
Member

cfriedt commented Mar 24, 2025

Seems like qemu_cortex_m0/nrf51822 doesn't have enough RAM for the integration tests

integration_platforms:

cfriedt
cfriedt previously approved these changes Mar 24, 2025
@DanTGL
Copy link
Contributor Author

DanTGL commented Mar 24, 2025

Seems like qemu_cortex_m0/nrf51822 doesn't have enough RAM for the integration tests

integration_platforms:

https://github.com/zephyrproject-rtos/zephyr/actions/runs/14022028991/job/39255224559?pr=87529#step:8:38

It's the tests in tests/posix/c_lib_ext that fail

The signedness of the variable caused undefined behavior because the
sign bit is modified when it gets left-shifted.

This fixes that by changing it to an unsigned variable.

Signed-off-by: Daniel Hajjar <daniel.hajjar16@gmail.com>
@DanTGL DanTGL force-pushed the fix_undefined_behavior branch from 89eb00e to a075306 Compare April 16, 2025 10:57
@kartben kartben merged commit 69713f4 into zephyrproject-rtos:main Apr 17, 2025
24 checks passed
@DanTGL DanTGL deleted the fix_undefined_behavior branch April 17, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: POSIX POSIX API Library size: XS A PR changing only a single line of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants