public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103993] New: Incorrect error generated by mismatched-new-delete
@ 2022-01-12 16:39 jjlindal at gmail dot com
  2022-01-12 16:41 ` [Bug c++/103993] " jjlindal at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jjlindal at gmail dot com @ 2022-01-12 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103993
           Summary: Incorrect error generated by mismatched-new-delete
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jjlindal at gmail dot com
  Target Milestone: ---

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-11.2.1-20211203/obj-x86_64-redhat-linux/isl-install
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=generic
--with-arch_32=i686 --build=x86_64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20211203 (Red Hat 11.2.1-7) (GCC) 

$ g++ -std=c++17 -D_J_HAS_PROC -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
-D_XFT_NO_COMPAT_ -I/usr/include/freetype2  -D_J_UNIX -D_J_HAS_XINERAMA -Wall
-Werror -I../include -I/usr/include/freetype2 -I/usr/include/libxml2 -O2  -c -o
code/JSimpleProcess.o code/JSimpleProcess.cpp -save-temps
In file included from /usr/local/include/ace/Svc_Handler.h:344,
                 from ../include/jx-af/jcore/JNetworkProtocolBase.h:11,
                 from ../include/jx-af/jcore/JMessageProtocol.h:11,
                 from ../include/jx-af/jcore/JSimpleProcess.h:16,
                 from code/JSimpleProcess.cpp:18:
In static member function ‘static void ACE_Svc_Handler<PEER_STREAM,
SYNCH_TRAITS>::operator delete(void*) [with PEER_STREAM = ACE_LSOCK_Stream;
SYNCH_TRAITS = ACE_MT_SYNCH]’,
    inlined from ‘JSimpleProcess::JSimpleProcess(pid_t, int, bool)’ at
code/JSimpleProcess.cpp:322:30:
/usr/local/include/ace/Svc_Handler.cpp:117:3: error: ‘void operator delete
[](void*)’ called on pointer returned from a mismatched allocation function
[-Werror=mismatched-new-delete]
  117 |   ::delete [] static_cast <char *> (obj);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/JSimpleProcess.cpp: In constructor ‘JSimpleProcess::JSimpleProcess(pid_t,
int, bool)’:
code/JSimpleProcess.cpp:322:37: note: returned from ‘static void*
ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS>::operator new(size_t) [with
PEER_STREAM = ACE_LSOCK_Stream; SYNCH_TRAITS = ACE_MT_SYNCH]’
  322 |         itsLink = new ProcessLink(fd);
      |                                     ^
In file included from /usr/local/include/ace/Svc_Handler.h:344,
                 from ../include/jx-af/jcore/JNetworkProtocolBase.h:11,
                 from ../include/jx-af/jcore/JMessageProtocol.h:11,
                 from ../include/jx-af/jcore/JSimpleProcess.h:16,
                 from code/JSimpleProcess.cpp:18:
In static member function ‘static void ACE_Svc_Handler<PEER_STREAM,
SYNCH_TRAITS>::operator delete(void*) [with PEER_STREAM = ACE_LSOCK_Stream;
SYNCH_TRAITS = ACE_MT_SYNCH]’,
    inlined from ‘JSimpleProcess::JSimpleProcess(pid_t, int, bool)’ at
code/JSimpleProcess.cpp:322:30:
/usr/local/include/ace/Svc_Handler.cpp:117:3: error: ‘void operator delete
[](void*)’ called on pointer returned from a mismatched allocation function
[-Werror=mismatched-new-delete]
  117 |   ::delete [] static_cast <char *> (obj);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/JSimpleProcess.cpp: In constructor ‘JSimpleProcess::JSimpleProcess(pid_t,
int, bool)’:
code/JSimpleProcess.cpp:322:37: note: returned from ‘static void*
ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS>::operator new(size_t) [with
PEER_STREAM = ACE_LSOCK_Stream; SYNCH_TRAITS = ACE_MT_SYNCH]’
  322 |         itsLink = new ProcessLink(fd);
      |                                     ^
cc1plus: all warnings being treated as errors

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

end of thread, other threads:[~2023-04-29 19:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 16:39 [Bug c++/103993] New: Incorrect error generated by mismatched-new-delete jjlindal at gmail dot com
2022-01-12 16:41 ` [Bug c++/103993] " jjlindal at gmail dot com
2022-01-12 18:31 ` [Bug middle-end/103993] -Wismatched-new-delete due to difference in inlining decisions msebor at gcc dot gnu.org
2022-04-25 21:13 ` andre at kostur dot net
2022-06-29 18:08 ` ed at catmur dot uk
2023-04-29 19:30 ` cdfrey at foursquare dot net

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).