-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative and more robust way of managing and working around #2708 #4080
Comments
I don't think we should clutter the code to workaround a bug in gcc but you can use methods described in #2708 to suppress it if needed. |
I also use as part of an include in other items and then test those other items. The workaround you specified in #2708 does NOT fix the specific issue that is provided in the description (another use case of tooling). So it is a half fix for some of the tooling use cases where GCC is used on it's own. @vitaut I agree the bug/issue is with the versions of clang and gnu compiler you use and how you use those in conjunction with eachother. If you don't wish the user experience of all use cases then why bother putting the workaround inside the CMakeLists.txt file in the first place? A lot of other open-source libraries provide The problem with putting it in the CMakeLists.txt as you specified is for particular use cases of tools that workaround (Using SYSTEM headers) does not work and therefore causes issue with consumption for all who use this library. Adding to every single target that consumes If there is no willingness to move forward with the fix described above, I will continue to wrap all of the header inclusion of all fmt/*.h functions within my own layer of headers to work-around this issue. But I strongly suggest you provide a more openness of fixing both clang-tidy and compiler issues in the code itself. |
I am OK with removing that workaround. Not completely sure why false positives in a specific version of GCC cause problem with your tooling. In any case it seems like a problem with the tooling and I think providing a wrapper header is a reasonable solution. |
The warning suppression in tests has been removed too, thanks for bringing this up. |
Original issue: #2708
When integrating in with various linters (clang-tidy-18) and building with the GNU compilers using cmake at the same time, the current definition of stringop-overflow doesn't work because clang attempts to check the
-Wno-stringop-overflow
compiler switch and is currently unaware of that.Compiler GNU: g++-14
And Cmake enabling of: clang-tidy-18 at the same time.
To mitigate this - I've had to do the following:
fmt_lib.h
Instead of adding a compiler directive in the compile options, would it be possible to just add the above to the
header-only
library at the beginning and end of any respective fmt/*.h file that has this stringop-overflow issue?Rationale:
-Wno-stringop-overflow
, it will be enabled for all consumers of the fmt::fmt or fmt::fmt-header-only INTERFACE CMake target. This is not ideal since I'd like the stringop-overflow to take effect and be checked in other areas of the code.Much appreciated.
The text was updated successfully, but these errors were encountered: