RTEMS | Wclobbered warnings (#5364)
Joel Sherrill (@joel)
gitlab at rtems.org
Sat Sep 27 21:43:20 UTC 2025
Joel Sherrill created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5364
## Summary
When you add -Wclobbered to the RTEMS warnings, these warnings are generated:
- cpukit/libdebugger/rtems-debugger-server.c:156:13: warning: variable 'ui' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libdebugger/rtems-debugger-server.c:1588:15: warning: variable 'addr' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libdebugger/rtems-debugger-server.c:1589:13: warning: variable 'length' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libdebugger/rtems-debugger-server.c:1612:15: warning: variable 'response' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libdebugger/rtems-debugger-server.c:1618:15: warning: variable 'addr' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libdebugger/rtems-debugger-server.c:1619:13: warning: variable 'length' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libdebugger/rtems-debugger-server.c:176:11: warning: variable 'ui' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libmisc/shell/main_mknod.c:134:26: warning: variable 'dev' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/libmisc/shell/main_mknod.c:384:19: warning: variable 'd' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- cpukit/score/cpu/arm/include/rtems/score/cpu.h:299:12: warning: variable 'level' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- testsuites/sptests/spcache01/init.c:191:32: warning: variable 'lock_context' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- testsuites/validation/tc-task-restart.c:772:22: warning: variable 'cpu_self' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- testsuites/validation/tx-thread-queue.c:295:21: warning: variable 'events' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
This [Stack Overflow discussiom](https://stackoverflow.com/questions/7721854/what-sense-do-these-clobbered-variable-warnings-make) is a discussion of this warning.
It is possible that adding the attribute "returns_twice" to setjmp() in the newlib header files could fix this. That attribute is not present now.
## Steps to reproduce
In spec/build/cpukit/optwarn.yml, comment out "-Werror" and add -Wclobbered.
### Pre-set options
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5364
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250927/7c11025c/attachment-0001.htm>
More information about the bugs
mailing list