[gdal-dev] GNU g++-13 and [[clang::fallthrough]]

Even Rouault even.rouault at spatialys.com
Sat Apr 29 08:46:02 PDT 2023


Andrew,

fixed per https://github.com/OSGeo/gdal/pull/7660 . Your patch proposal 
didn't work with older gcc versions that don't like the "::" in 
_has_cpp_attribute(clang::fallthrough). I've reworked & simplified it. 
I've verified it silences the warning with 23.04 + gcc 13

Even

Le 29/04/2023 à 17:00, Andrew C Aitchison a écrit :
> On Sat, 29 Apr 2023, Andrew C Aitchison wrote:
>
>
>> Ubuntu 23-04 (Lunar) has g++ v13.0.1 (in the universe section,
>> this is not the default g++ compiler).
>> At least as curently shipped, this warns about the line
>>     [[clang::fallthrough]];
>> (partly becuase with the default settings
>>     [[fallthrough]];
>> is now needed to silence warnings where a fallthrough *is* intended).
>>
>> Based on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109653#c3
>> I have attached a patch for ports/cpl_port.h
>
> Sorry, the previous patch did not mauch gdal's usage of CPL_FALLTHROUGH.
> Please use this patch instead.
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230429/433134b7/attachment.htm>


More information about the gdal-dev mailing list