]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix warning regressions in <bits/stl_tempbuf.h>
authorJonathan Wakely <jwakely@redhat.com>
Tue, 18 Jun 2024 19:53:53 +0000 (20:53 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 19 Jun 2024 12:35:23 +0000 (13:35 +0100)
commit8c52adcf5f9812ef66aeef357590fb2f148302f7
tree09470a76ae2aa253dfa8dc10b9ea6acf23cd9082
parentc6a9ab8c920f297c4efd289182aef9fbc73f5906
libstdc++: Fix warning regressions in <bits/stl_tempbuf.h>

I caused some new warnings with -Wsystem-headers with my recent changes
to std::get_temporary_buffer and std::_Temporary_buffer. There's a
-Wsign-compare warning which can be avoided by casting the ptrdiff_t
argument to size_t (which also conveniently rejects negative values).

There's also a -Wdeprecated-declarations warning because I moved where
std::get_temporary_buffer is called, but didn't move the diagnostic
pragmas that suppress the warning for calling it.

libstdc++-v3/ChangeLog:

* include/bits/stl_tempbuf.h (__get_temporary_buffer): Cast
argument to size_t to handle negative values and suppress
-Wsign-compare warning.
(_Temporary_buffer): Move diagnostic pragmas to new location of
call to std::get_temporary_buffer.
libstdc++-v3/include/bits/stl_tempbuf.h