public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/15885] New: spurious or misleading va_start warning Date: Tue, 08 Jun 2004 23:38:00 -0000 [thread overview] Message-ID: <20040608233841.15885.snyder@fnal.gov> (raw) When compiling the source below, gcc produces the warnings x.cc:8: warning: second parameter of `va_start' not last named argument x.cc:8: warning: second parameter of `va_start' not last named argument which is at best misleading, as the second argument of va_start actually is the last named argument. gcc appears to give this warning in this case if the argument is also passed by reference somewhere in the function, as it is here in the call to bar(). I don't have my copy of the standard handy, so i'm not completely sure that there isn't a restriction about taking a reference to an argument used in va_start. However, even if this test case is actually not valid, the warning message should be changed to reflect the true problem. Environment: System: Linux karma 2.6.6 #15 Thu May 13 15:07:54 EDT 2004 i686 i686 i386 GNU/Linux Architecture: i686 <machine, os, target, libraries (multiple lines)> host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /home/sss/gcc/gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f95 How-To-Repeat: Compile the following: ---------------------------- #include <cstdarg> void bar(const int&); void foo (int x, ...) { va_list ap; va_start (ap, x); bar(x); } ---------------------------- ------- Additional Comments From snyder at fnal dot gov 2004-06-08 23:38 ------- Fix: <how to correct or work around the problem, if known (multiple lines)> -- Summary: spurious or misleading va_start warning Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: snyder at fnal dot gov CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15885
next reply other threads:[~2004-06-08 23:38 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-06-08 23:38 gcc-bugzilla at gcc dot gnu dot org [this message] 2004-06-08 23:45 ` [Bug middle-end/15885] [3.5 Regression] " pinskia at gcc dot gnu dot org 2004-06-08 23:52 ` pinskia at gcc dot gnu dot org 2004-06-09 0:38 ` pinskia at gcc dot gnu dot org 2004-06-09 16:04 ` pinskia at gcc dot gnu dot org 2004-06-17 22:42 ` pinskia at gcc dot gnu dot org 2004-07-13 18:13 ` [Bug middle-end/15885] [3.5 Regression] wrong va_start warning (and code) jason at gcc dot gnu dot org 2004-07-15 21:50 ` cvs-commit at gcc dot gnu dot org 2004-07-15 22:08 ` 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=20040608233841.15885.snyder@fnal.gov \ --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).