gdraheim / zziplib

The ZZIPlib provides read access on ZIP-archives and unpacked data. It features an additional simplified API following the standard Posix API for file access
Other
60 stars 50 forks source link

Unrecognized command line option "-Warray-bounds" #129

Closed mojca closed 1 year ago

mojca commented 2 years ago

The flag -Warray-bounds added by https://github.com/gdraheim/zziplib/blob/master/zzip/CMakeLists.txt#L118 is apparently not recognised by all compilers.

Maybe https://cmake.org/cmake/help/latest/module/CheckCXXCompilerFlag.html could be used to check whether the flag is supported before unconditionally adding one.

(Admittedly this is about a "slightly older" compiler, so in case you consider this too much of a hassle, we can patch the sources locally.)

Reported by @evanmiller in https://trac.macports.org/ticket/63951.

gdraheim commented 2 years ago

All the extra warnings should be wrapped in proper tests. The marked if(unix) is just a residual from the conversion from autoconf/automake where it had a differen condition which was not easy to port over.

For autoconf I had written a number of macros to be able to check compiler flags as compilers can express the same option very very differently and previous authors were wrong in too many occasions. When converting the parts to cmake I did not invest the time to get to that detail degree again and this was the simplest approach you see now.

gdraheim commented 1 year ago

Solved by pull request #139 submitted by @barracuda156