From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13634 invoked by alias); 30 Apr 2014 16:33:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13604 invoked by uid 48); 30 Apr 2014 16:33:43 -0000 From: "bilbotheelffriend at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61018] New: -Wvarargs does not print warning for memer functions Date: Wed, 30 Apr 2014 16:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: bilbotheelffriend at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg02291.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61018 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 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 =E2=80=98y=E2=80=99 [-Wunused-paramet= er] void foo(int x, int y, ...) Test-case for non-member function: #include void foo(int x, int y, ...) { va_list ap; va_start (ap, x); } Compiling with g++ -Wvarargs additionally prints: foo.cpp: In function =E2=80=98void foo(int, int, ...)=E2=80=99: foo.cpp:6:19: warning: second parameter of =E2=80=98va_start=E2=80=99 not l= ast named argument [-Wvarargs] va_start (ap, x); g++ -v: Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 4.8.2-19ubuntu1' --with-bugurl=3Dfile:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=3Dc,c++,java,go,d,fortran,objc,obj-c++ --prefix=3D/usr --program-suffix=3D-4.8 --enable-shared --enable-linker-build-id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --with-gxx-include-dir=3D/usr/include/c++/4.8 --libdir=3D/usr/lib --enable-nls --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=3Dgtk --enable-gtk-cairo --with-java-home=3D/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=3D/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=3D/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=3Damd64 --with-ecj-jar=3D/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --with-tune=3Dgeneric --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_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: 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: List-Archive: List-Post: List-Help: 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" 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: In-Reply-To: References: 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?id=7652 --- Comment #27 from Matthew Woehlke --- (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).