Page MenuHomeFreeBSD

Silence GCC warnings when using libc++ headers.
ClosedPublic

Authored by jhb on Nov 29 2022, 7:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 4:32 AM
Unknown Object (File)
Sep 21 2024, 9:36 AM
Unknown Object (File)
Sep 21 2024, 9:35 AM
Unknown Object (File)
Sep 21 2024, 9:35 AM
Unknown Object (File)
Sep 21 2024, 9:35 AM
Unknown Object (File)
Sep 17 2024, 7:54 PM
Unknown Object (File)
Sep 5 2024, 7:02 AM
Unknown Object (File)
Aug 31 2024, 5:42 AM

Details

Summary

GCC 12 raises warnings about literal operator suffixes not preceded by
'_' in libc++ headers such as <string_view> as it doesn't recognize
libc++ headers being an implementation of the standard.

GCC 12 also warns about clang-specific pragmas in <locale>.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Nov 29 2022, 7:30 PM
share/mk/bsd.sys.mk
222

Any reason we want to have this for all the files in the system?

jhb added inline comments.
share/mk/bsd.sys.mk
222

Because I couldn't find a way to shut it up for "any file that #includes <string_view>" or any host of other standard headers provided by libc++. In theory we could patch all the headers in libc++ to explicitly disable this warning via #pragma push/pop but that would probably give @dim nightmares. Similarly, we could perhaps patch <locale> but I suspect that wouldn't be ideal either.

share/mk/bsd.sys.mk
222

OK. That's a decent reason :).
Might want to mention that it's suboptimal in the commit message then

share/mk/bsd.sys.mk
222

That's fair.

emaste added inline comments.
share/mk/bsd.sys.mk
222

Maybe also in a comment here?

This revision is now accepted and ready to land.Nov 29 2022, 10:03 PM
jhb marked 2 inline comments as done.Nov 30 2022, 10:53 PM
This revision was automatically updated to reflect the committed changes.