You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If code will be compiled by multiple compilers / versions, consider defining a macro such as ADAFRUIT_FALLTHROUGH, that conditionally defines to C++17, GCC, or CLANG as available.
The text was updated successfully, but these errors were encountered:
there is no need for ADAFRUIT_FALLTHROUGH just either use attribute fallthru or [[fallthrough]]. We only need to fix current gcc and worry about other compiler later on when needed.
I agree that is a preferred attribute. Now the difficulty is in verifying that the code is actually doing the "right thing" in each case, before using this attribute. Else, the attribute will hide a true bug from smart compiler warnings.
@henrygab yeah, but I don't think we could find anyone that could insert it into the "right place" any time soon :(. Let's leave it as it is for now :)
Currently three files use the following to disable this warning on a couple functions:
That was done as a temporary measure in #207 to allow finding/fixing other issues in the code exposed by compiling with
-Wall
.Here's a list of correct ways to fix these implicit fallthrough warnings:
[[fallthrough]]
attribute[[gnu::fallthrough]]
[[clang::fallthrough]]
attribute__attribute__(( fallthrough ))
NOTE: The comment method is legacy and very fragile. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78497
If code will be compiled by multiple compilers / versions, consider defining a macro such as ADAFRUIT_FALLTHROUGH, that conditionally defines to C++17, GCC, or CLANG as available.
The text was updated successfully, but these errors were encountered: