Re: [PATCH 06/61] xfs: Fix fall-through warnings for Clang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/15/21 6:07 PM, Darrick J. Wong wrote:

I'd like to wrap this in

#ifdef __has_attribute

(with another else to define it away) so we don't have any gcc version surprises.
Ok?  (yes, yes, old gcc yuck but would rather not break it if we don't have to)

#if defined __has_attribute
#  if __has_attribute(__fallthrough__)
#    define fallthrough                    __attribute__((__fallthrough__))
#  else
#    define fallthrough                    do {} while (0)  /* fallthrough */
#  endif
#else
#    define fallthrough                    do {} while (0)  /* fallthrough */
#endif

Unless there's objection I'll do that before I merge it.

(note, can't do #if defined __has_attribute && __has_attribute(), as shown at
https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html)

Thanks,
-Eric

+#if __has_attribute(__fallthrough__)
+# define fallthrough                    __attribute__((__fallthrough__))
+#else
+# define fallthrough                    do {} while (0)  /* fallthrough */
+#endif



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux