public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "irving at cs dot stanford dot edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/30988] New: Incorrect "no return statement" warning with __attribute__ ((noreturn)) and __FUNCTION__ Date: Tue, 27 Feb 2007 22:19:00 -0000 [thread overview] Message-ID: <bug-30988-12477@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 2890 bytes --] The following code incorrectly warns that the function g is missing a return statement. The warning goes away if __FUNCTION__ is replaced by (const char*)__FUNCTION__. ================ BEGIN CODE ================== void f(const char*) __attribute__ ((noreturn)); template<class T> class A { int g() { f(__FUNCTION__); //f((const char*)__FUNCTION__); } }; template class A<int>; ============================ END code wedge:scratch% g++ -O3 -Wall -c -v noreturn.cpp Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux Thread model: posix gcc version 4.1.1 20060525 (Red Hat 4.1.1-1) /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/cc1plus -quiet -v -D_GNU_SOURCE noreturn.cpp -quiet -dumpbase noreturn.cpp -mtune=generic -auxbase noreturn -O3 -Wall -version -o /tmp/ccVj3EZ3.s ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../x86_64-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/x86_64-redhat-linux /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/backward /usr/local/include /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include /usr/include End of search list. GNU C++ version 4.1.1 20060525 (Red Hat 4.1.1-1) (x86_64-redhat-linux) compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 56236c31509b2b0d4a3c4ac0327da7d9 noreturn.cpp: In member function int A<T>::g(): noreturn.cpp:10: warning: no return statement in function returning non-void as -V -Qy -o noreturn.o /tmp/ccVj3EZ3.s GNU assembler version 2.16.91.0.6 (x86_64-redhat-linux) using BFD version 2.16.91.0.6 20060212 -- Summary: Incorrect "no return statement" warning with __attribute__ ((noreturn)) and __FUNCTION__ Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: irving at cs dot stanford dot edu GCC build triplet: x86_64-redhat-linux GCC host triplet: x86_64-redhat-linux GCC target triplet: x86_64-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30988
next reply other threads:[~2007-02-27 22:19 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-02-27 22:19 irving at cs dot stanford dot edu [this message] 2007-02-28 0:26 ` [Bug c++/30988] " pinskia at gcc dot gnu dot org 2007-03-03 21:50 ` [Bug c++/30988] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org 2007-03-05 4:11 ` mmitchel at gcc dot gnu dot org 2007-03-13 22:57 ` spark at gcc dot gnu dot org 2007-11-17 12:34 ` jakub at gcc dot gnu dot org 2007-11-17 12:36 ` jakub at gcc dot gnu dot org 2007-11-18 22:21 ` [Bug c++/30988] [4.1/4.2 " jakub at gcc dot gnu dot org 2007-11-18 22:21 ` [Bug c++/30988] [4.1/4.2/4.3 " jakub at gcc dot gnu dot org 2008-07-04 22:00 ` [Bug c++/30988] [4.2 " jsm28 at gcc dot gnu dot org 2009-03-30 21:40 ` jsm28 at gcc dot gnu dot org 2009-03-30 21:43 ` irving at naml dot us
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-30988-12477@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: linkBe 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).