google / wuffs

Wrangling Untrusted File Formats Safely
Other
4.07k stars 129 forks source link

Fix -Wimplicit-fallthrough for Clang. #48

Closed pkasting closed 3 years ago

pkasting commented 3 years ago

WUFFS_BASEFALLTHROUGH was not defined because the generated output is C (so cplusplus is never defined) and Clang was explicitly excluded from the attribute case (though it would have worked).

Instead test for the availability of the fallthrough attribute directly, which should be more portable.

Bug: chromium:995993

nigeltao commented 3 years ago

Thanks!

I have a couple of nits (e.g. the space in "https:// gcc.gnu.org" looks unusual) but I'll address those in a follow-up commit.

pkasting commented 3 years ago

Whoops, don't know how that space got in there! Thanks for cleaning up after me...