Closed r-barnes closed 2 years ago
I think adding a break here looks like the correct fix. If not, we should add a comment indicating that the fall-thru is expected or copy the code to eliminate the fall-thru.
The fall through is intentional. I would prefer using a comment to indicate that, to keep it as efficient as possible.
@sahrk Do you have preferred C++ standard for building DGGRID in? If we use C++17 then there is a [[fallthrough]];
statement which will suppress this warning.
Otherwise in C++11 and C++14 we can use [[gnu::fallthrough]];
and __attribute__((fallthrough))
or __attribute__((__fallthrough__))
for clang.
I'm going to have to think about this one. I hate to require C++17 for this one case, but I'm also not a fan of adding compiler-specific code just to suppress a compiler warning.
Okay, thanks, @sahrk
@r-barnes I've created a FALLTHROUGH macro to handle this and pushed the fix to master. I'll leave this open for now in case you find any problem with it.
Fixes: