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)
Sun, Apr 28, 10:40 AM
Unknown Object (File)
Fri, Apr 26, 6:47 AM
Unknown Object (File)
Fri, Apr 26, 1:58 AM
Unknown Object (File)
Dec 23 2023, 12:47 AM
Unknown Object (File)
Dec 16 2023, 5:13 PM
Unknown Object (File)
Dec 10 2023, 11:21 AM
Unknown Object (File)
Sep 30 2023, 7:14 PM
Unknown Object (File)
Sep 21 2023, 10:21 PM

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 48531
Build 45417: arc lint + arc unit

Event Timeline

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

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

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

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
216

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

share/mk/bsd.sys.mk
216

That's fair.

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

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.