public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jjlindal at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/103993] New: Incorrect error generated by mismatched-new-delete
Date: Wed, 12 Jan 2022 16:39:31 +0000	[thread overview]
Message-ID: <bug-103993-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2022-01-12 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 16:39 jjlindal at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103993-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).