Joel Sherrill commented on a discussion on 
cpukit/include/rtems/score/basedefs.h: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/730#note_131224

 > +/**
 > + * @ingroup RTEMSAPIBaseDefs
 > + *
 > + * @brief This macro expands to a fall through hint.
 > + *
 > + * In C switch statement, it is possible for one case to "fall through"
 > + * to the next. Until C23, there was no standard way for the programmer
 > + * to tell the compiler this was intentional. Many times, not having
 > + * a "break" statement is an error. This macro standardizes the hint
 > + * for RTEMS source code.
 > + *
 > + * @note GCC recognizes many comment strings with "fall through" as
 > + *       a hint. But a cpp macro cannot insert a comment.
 > + */
 > +#if __STDC_VERSION__ >= 202311L
 > +  #define RTEMS_FALL_THROUGH() [[fallthrough]]

Because we may decide to compile as C17 or with a compiler other than GCC or 
clang.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/730#note_131224
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to