public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103848] New: std::deque<>::operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant"
@ 2021-12-28  2:24 stefan.bruens@rwth-aachen.de
  2021-12-28  2:39 ` [Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning pinskia at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: stefan.bruens@rwth-aachen.de @ 2021-12-28  2:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848

            Bug ID: 103848
           Summary: std::deque<>::operator- uses "0" for nullptr check,
                    triggers "zero-as-null-pointer-constant"
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefan.bruens@rwth-aachen.de
  Target Milestone: ---

Since
https://github.com/gcc-mirror/gcc/commit/f6be5d6ee31b76838e242704782938bc9745659c

using `operator-` may fail:

```
[  346s] In file included from /usr/include/c++/11/deque:67,
[  346s]                  from /usr/include/c++/11/queue:60,
...
[  346s] /usr/include/c++/11/bits/stl_deque.h:356:58: error: zero as null
pointer constant [-Werror=zero-as-null-pointer-constant]
[  346s]   356 |           * (__x._M_node - __y._M_node - int(__x._M_node !=
0))
[  346s]       |                                              ~~~~~~~~~~~~^~~~
[  346s] cc1plus: some warnings being treated as errors
```

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-04-21 12:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28  2:24 [Bug libstdc++/103848] New: std::deque<>::operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" stefan.bruens@rwth-aachen.de
2021-12-28  2:39 ` [Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning pinskia at gcc dot gnu.org
2022-01-04 13:38 ` rguenth at gcc dot gnu.org
2022-01-04 14:31 ` redi at gcc dot gnu.org
2022-01-04 15:15 ` jakub at gcc dot gnu.org
2022-01-04 15:42 ` redi at gcc dot gnu.org
2022-01-04 15:58 ` redi at gcc dot gnu.org
2022-01-04 16:02 ` jakub at gcc dot gnu.org
2022-01-04 16:18 ` redi at gcc dot gnu.org
2022-01-05  3:08 ` stefan.bruens@rwth-aachen.de
2022-01-05  9:22 ` redi at gcc dot gnu.org
2022-01-05  9:31 ` jakub at gcc dot gnu.org
2022-01-05 13:47 ` cvs-commit at gcc dot gnu.org
2022-04-21  7:51 ` [Bug libstdc++/103848] [11 " rguenth at gcc dot gnu.org
2022-04-21 12:32 ` cvs-commit at gcc dot gnu.org
2022-04-21 12:39 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).