For the new Linux/Fedora configuration with introduction of gcc 7.2,
option -Wimplicit-fallthrough is implemented. This option requests a
warning if a switch case falls through into the next case. This was
causing build errors.
For C++17 (and g++ 7 regardless), standard attribute [[fallthrough]]
notifies the compiler that the fallthrough is intentional.
For clang++ 5 (with -std=c++11 or later) and g++ 7, built-in
preprocessor function __has_cpp_attribute(fallthrough) returns true.
Currently, msvc does not have __has_cpp_attribute.
Note: The use of __has_cpp_attribute has been proposed for c++2x and
is advocated by (81-char link broken in two to avoid 80 char hard limit):
https://isocpp.org/std/standing-documents/
sd-6-sg10-feature-test-recommendations
For gcc 7, a comment consisting of "FALLTHROUGH" will accomplish the
same thing with -Wimplicit-fallthrough=<n>, for n <= 4.
The diagnostic:
/opt/src/src/vpg-compute-neo/runtime/mem_obj/image.cpp:146:24: error:
this statement may fall through [-Werror=implicit-fallthrough=]
imageDepth = imageDesc->image_depth;
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/src/src/vpg-compute-neo/runtime/mem_obj/image.cpp:148:9: note: here
case CL_MEM_OBJECT_IMAGE2D:
^~~~
Change-Id: I604700a23b09c8bf22baf5614700a8b76dbe4cdd
Signed-off-by: Dale Stimson <dale.b.stimson@intel.com>