public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "loose at astron dot nl" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/19291] New: Warning "cannot pass objects of non-POD type" should be an error
Date: Thu, 06 Jan 2005 13:48:00 -0000	[thread overview]
Message-ID: <20050106134743.19291.loose@astron.nl> (raw)

<code>
#include <string>
#include <cstdio>
int main()
{
  std::string s("Hello World");
  printf("%s\n", s);
  return 0;
}
</code>

$ /usr/local/gcc343/bin/g++ nonPODWarn.cc
nonPODWarn.cc: In function `int main()':
nonPODWarn.cc:6: warning: cannot pass objects of non-POD type `struct 
std::string' through `...'; call will abort at runtime

This warning should IMHO really be turned into an error. The diagnostic ends 
with "... call will abort at runtime", which sounds pretty severe to me!


$ /usr/local/gcc343/bin/g++ -v -save-temps nonPODWarn.cc
Reading specs from /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/gcc343 --enable-
threads=posix
Thread model: posix
gcc version 3.4.3
 /usr/local/gcc343/libexec/gcc/i686-pc-linux-gnu/3.4.3/cc1plus -E -quiet -v -
D_GNU_SOURCE nonPODWarn.cc -mtune=pentiumpro -o nonPODWarn.ii
ignoring nonexistent directory "/usr/local/gcc343/lib/gcc/i686-pc-linux-
gnu/3.4.3/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3
 /usr/local/gcc343/lib/gcc/i686-pc-linux-
gnu/3.4.3/../../../../include/c++/3.4.3/i686-pc-linux-gnu
 /usr/local/gcc343/lib/gcc/i686-pc-linux-
gnu/3.4.3/../../../../include/c++/3.4.3/backward
 /usr/local/include
 /usr/local/gcc343/include
 /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/include
 /usr/include
End of search list.
 /usr/local/gcc343/libexec/gcc/i686-pc-linux-gnu/3.4.3/cc1plus -fpreprocessed 
nonPODWarn.ii -quiet -dumpbase nonPODWarn.cc -mtune=pentiumpro -auxbase 
nonPODWarn -version -o nonPODWarn.s
GNU C++ version 3.4.3 (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
nonPODWarn.cc: In function `int main()':
nonPODWarn.cc:6: warning: cannot pass objects of non-POD type `struct 
std::string' through `...'; call will abort at runtime
 as -V -Qy -o nonPODWarn.o nonPODWarn.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 
2.13.90.0.18 20030206
 /usr/local/gcc343/libexec/gcc/i686-pc-linux-gnu/3.4.3/collect2 --eh-frame-hdr -
m elf_i386 -dynamic-linker /lib/ld-
linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/gcc343/lib/gcc/i686-pc-
linux-gnu/3.4.3/crtbegin.o -L/usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3 -
L/usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/../../.. nonPODWarn.o -
lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/gcc343/lib/gcc/i686-pc-
linux-gnu/3.4.3/crtend.o /usr/lib/crtn.o

-- 
           Summary: Warning "cannot pass objects of non-POD type" should be
                    an error
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: loose at astron dot nl
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19291


             reply	other threads:[~2005-01-06 13:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06 13:48 loose at astron dot nl [this message]
2005-01-06 14:04 ` [Bug c++/19291] " pinskia at gcc dot gnu dot org

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=20050106134743.19291.loose@astron.nl \
    --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).