public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61018] New: -Wvarargs does not print warning for memer functions
@ 2014-04-30 16:33 bilbotheelffriend at gmail dot com
  2014-11-10 13:41 ` [Bug c++/61018] -Wvarargs does not print warning for member functions redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bilbotheelffriend at gmail dot com @ 2014-04-30 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61018
           Summary: -Wvarargs does not print warning for memer functions
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bilbotheelffriend at gmail dot com

Hi,
    It appears to me that, g++ does not warn for -Wvarargs for member
functions.

For the following test-case:
#include <cstdarg>

struct f
{
  void foo(int x, int y, ...)
  {
    va_list ap;
    va_start (ap, x);
  }
};

I compiled it with g++ -Wvarargs, and it only printed the warning:
wa.cpp:4:6: warning: unused parameter ‘y’ [-Wunused-parameter]
 void foo(int x, int y, ...)

Test-case for non-member function:
#include <cstdarg>

void foo(int x, int y, ...)
{
  va_list ap;
  va_start (ap, x);
}

Compiling with g++ -Wvarargs additionally prints:
foo.cpp: In function ‘void foo(int, int, ...)’:
foo.cpp:6:19: warning: second parameter of ‘va_start’ not last
named argument [-Wvarargs]
   va_start (ap, x);

g++ -v:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.8.2-19ubuntu1'
--with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --disable-libmudflap --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

Thanks and Regards,
Prathamesh
>From gcc-bugs-return-450272-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 30 16:34:20 2014
Return-Path: <gcc-bugs-return-450272-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14532 invoked by alias); 30 Apr 2014 16:34:20 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 14463 invoked by uid 48); 30 Apr 2014 16:34:17 -0000
From: "mw_triad at users dot sourceforge.net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/7652] -Wswitch-break : Warn if a switch case falls through
Date: Wed, 30 Apr 2014 16:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: mw_triad at users dot sourceforge.net
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-7652-4-XwEJDayP6e@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-7652-4@http.gcc.gnu.org/bugzilla/>
References: <bug-7652-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02292.txt.bz2
Content-length: 570

http://gcc.gnu.org/bugzilla/show_bug.cgi?idv52

--- Comment #27 from Matthew Woehlke <mw_triad at users dot sourceforge.net> ---
(In reply to Marek Polacek from comment #26)
> Perhaps we could invent __builtin_fallthrough or some such.

Yes, I was expecting there would be some alternate spelling for cases where
C++11 attributes are not available, e.g. using __attribute__ or
__builtin_fallthrough or some such. Please support [[gnu:fallthrough]] also,
though, for consistency with clang (and it gives more weight to eventually
making [[fallthrough]] standardized).


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

end of thread, other threads:[~2015-02-24 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 16:33 [Bug c++/61018] New: -Wvarargs does not print warning for memer functions bilbotheelffriend at gmail dot com
2014-11-10 13:41 ` [Bug c++/61018] -Wvarargs does not print warning for member functions redi at gcc dot gnu.org
2014-11-10 16:51 ` [Bug c++/61018] [5 Regression] " manu at gcc dot gnu.org
2014-12-01 12:01 ` [Bug c++/61018] [4.8/4.9/5 " rguenth at gcc dot gnu.org
2014-12-09 17:38 ` [Bug middle-end/61018] " jason at gcc dot gnu.org
2014-12-19 13:43 ` jakub at gcc dot gnu.org
2015-02-24 11:31 ` jakub at gcc dot gnu.org

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