Page MenuHomeFreeBSD

bsd.sys.mk: Disable -Wdangling-reference for GCC 13+
ClosedPublic

Authored by jhb on Nov 13 2023, 10:29 PM.
Tags
None
Referenced Files
F144333136: D42579.id130114.diff
Sat, Feb 7, 9:44 PM
F144304496: D42579.id130052.diff
Sat, Feb 7, 6:16 PM
Unknown Object (File)
Sat, Jan 31, 2:19 PM
Unknown Object (File)
Thu, Jan 15, 7:12 PM
Unknown Object (File)
Dec 26 2025, 7:53 AM
Unknown Object (File)
Dec 20 2025, 2:54 AM
Unknown Object (File)
Dec 9 2025, 3:36 PM
Unknown Object (File)
Dec 9 2025, 1:54 PM
Subscribers

Details

Summary

GCC raises this warning for libc++'s istream. It raises false
positives in other cases as well (GCC bugs 109640, 109642, 109671).

Warning from <istream>:

/usr/include/c++/v1/istream:1464:34: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
1464 | const ctype<_CharT>& ct = std::use_facet<ctype<_CharT> >(is.getloc());

|                                  ^~~~

/usr/include/c++/v1/istream:1464:71: note: the temporary was destroyed at the end of the full expression 'std::1::use_facet<ctype<char> >(std::1::ios_base::getloc() const())'
1464 | const ctype<_CharT>& ct = std::use_facet<ctype<_CharT> >(is.getloc());

|                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

Diff Detail

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