RTEMS | cpukit/include/rtems/confdefs: Improved comments on the #pragmas to ignore warnings issue (!1208)

Samuel Viegas (@samuel.viegas) gitlab at rtems.org
Tue Apr 21 10:12:09 UTC 2026




Samuel Viegas commented on a discussion on cpukit/include/rtems/confdefs/inittask.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1208#note_148838

 >  #endif
 >  
 >  /*
 > - * Ignore the following warnings from g++ and clang in the uses of
 > - * _CONFIGURE_ASSERT_NOT_NULL() below:
 > - *
 > - * warning: the address of 'void Init()' will never be NULL [-Waddress]
 > - *
 > - * warning: comparison of function 'Init' not equal to a null pointer is always
 > - * true [-Wtautological-pointer-compare]
 > +  * _CONFIGURE_ASSERT_NOT_NULL is used to validate function pointers at compile time.
 > +  * When the configured value is a function symbol (e.g., void Init()), the compiler proves that its address is never NULL and reports the comparison as tautological.
 > +  * This is expected for this assertion pattern, triggering warnings (e.g., -Waddress and -Wtautological-pointer-compare).
 > +  * Those warnings are therefore suppressed locally because they are a by-product of the assertion, not a real defect.
 > +  * Additionally, -Wpragmas is suppressed since some toolchains may not support every warning option named below,
 > +  * which maintains compatibility across different toolchains without causing unnecessary warnings.

Right, you are referring to the preprocessor check that triggers an error message, correct? Do you want me to add a comment stating that here as well?

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1208#note_148838
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/20260421/15cb3424/attachment-0001.htm>


More information about the bugs mailing list