Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_grtc.h won't build with -Werror flag #134

Open
m-gorecki opened this issue Jan 30, 2025 · 0 comments
Open

nrf_grtc.h won't build with -Werror flag #134

m-gorecki opened this issue Jan 30, 2025 · 0 comments

Comments

@m-gorecki
Copy link

Building file that includes nrf_grtc.h header causes an error when -Werror flag is enabled:

| Error: In file included from repos/apache-mynewt-core/hw/mcu/nordic/nrf54lxx/src/hal_os_tick.c:24:
| repos/nordic-nrfx/hal/nrf_grtc.h: In function 'nrf_grtc_sys_counter_get':
| repos/nordic-nrfx/hal/nrf_grtc.h:1598:14: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|  1598 |     return *((const uint64_t volatile *)&p_reg->GRTC_SYSCOUNTER.SYSCOUNTERL);
|       |             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| repos/nordic-nrfx/hal/nrf_grtc.h: In function 'nrf_grtc_sys_counter_indexed_get':
| repos/nordic-nrfx/hal/nrf_grtc.h:1619:14: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|  1619 |     return *((const uint64_t volatile *)&p_reg->SYSCOUNTER[index]);
|       |             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors

I'm using arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant