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

* [Bug c++/61018] -Wvarargs does not print warning for member functions
  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 ` redi at gcc dot gnu.org
  2014-11-10 16:51 ` [Bug c++/61018] [5 Regression] " manu at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-11-10 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-10
     Ever confirmed|0                           |1


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

* [Bug c++/61018] [5 Regression] -Wvarargs does not print warning for member functions
  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 ` 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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2014-11-10 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org
   Target Milestone|---                         |5.0
            Summary|-Wvarargs does not print    |[5 Regression] -Wvarargs
                   |warning for member          |does not print warning for
                   |functions                   |member functions

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
It seems a regression, because GCC 4.4.5 did warn.
>From gcc-bugs-return-466275-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 10 16:55:43 2014
Return-Path: <gcc-bugs-return-466275-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16218 invoked by alias); 10 Nov 2014 16:55:43 -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 16154 invoked by uid 48); 10 Nov 2014 16:55:39 -0000
From: "howarth at bromo dot med.uc.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61407] Build errors on latest OS X 10.10 Yosemite with Xcode 6 on GCC 4.8.3
Date: Mon, 10 Nov 2014 16:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: howarth at bromo dot med.uc.edu
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: cc
Message-ID: <bug-61407-4-bnzl140H5N@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61407-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61407-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-11/txt/msg00747.txt.bz2
Content-length: 1301

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida407

howarth at bromo dot med.uc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |howarth at bromo dot med.uc.edu

--- Comment #46 from howarth at bromo dot med.uc.edu ---
(In reply to Francois-Xavier Coudert from comment #45)
> (In reply to Jeremy Huddleston Sequoia from comment #42)
> > The committed patch is incorrect.  It makes an invalid assumption which
> > breaks the usage of deployment targets such as 10.9.3.
>
> All Apple doc I can find has deployment targets of the form 10.x or 10.x.0
> (where x is integer, but not only one digit).

If Jeremy really disagreed on that change, he hasn't acted on it in the gcc49
MacPorts packaging that he maintains (which still uses the original proposed
patch from https://gcc.gnu.org/ml/gcc-patches/2014-08/msg02428.html). FYI, as
far as llvm-gcc 4.2.1 is concerned, in my fink legacy package for Apple's
llvm-gcc 4.2.1, I used a back port of our patch,
http://fink.cvs.sourceforge.net/viewvc/fink/dists/10.7/stable/main/finkinfo/languages/llvm-gcc42-yosemite.patch.
Neither gcc 4.9.2 nor the patched llvm-gcc 4.2.1 has shown any problems on OS X
10.9.5.


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

* [Bug c++/61018] [4.8/4.9/5 Regression] -Wvarargs does not print warning for member functions
  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 ` rguenth at gcc dot gnu.org
  2014-12-09 17:38 ` [Bug middle-end/61018] " jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-01 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Target Milestone|5.0                         |4.8.4


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

* [Bug middle-end/61018] [4.8/4.9/5 Regression] -Wvarargs does not print warning for member functions
  2014-04-30 16:33 [Bug c++/61018] New: -Wvarargs does not print warning for memer functions bilbotheelffriend at gmail dot com
                   ` (2 preceding siblings ...)
  2014-12-01 12:01 ` [Bug c++/61018] [4.8/4.9/5 " rguenth at gcc dot gnu.org
@ 2014-12-09 17:38 ` 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
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2014-12-09 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
          Component|c++                         |middle-end

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
This is because the inline function is never used, so it doesn't get the
lowering that produces the warning.  A C testcase with a non-member inline
function sees the same behavior:

#include <stdarg.h>

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

but if you add a call to foo, the warning is generated.

int main()
{
  foo(1,2,3);
}


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

* [Bug middle-end/61018] [4.8/4.9/5 Regression] -Wvarargs does not print warning for member functions
  2014-04-30 16:33 [Bug c++/61018] New: -Wvarargs does not print warning for memer functions bilbotheelffriend at gmail dot com
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |4.8.5

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.


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

* [Bug middle-end/61018] [4.8/4.9/5 Regression] -Wvarargs does not print warning for member functions
  2014-04-30 16:33 [Bug c++/61018] New: -Wvarargs does not print warning for memer functions bilbotheelffriend at gmail dot com
                   ` (4 preceding siblings ...)
  2014-12-19 13:43 ` jakub at gcc dot gnu.org
@ 2015-02-24 11:31 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-24 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I really don't see why this is considered a bug.  Some diagnostics are simply
performed only on code that is actually used.  You can always use
-fkeep-inline-functions which causes it to warn, or just use the method.  If
you never use it, it isn't that important if it is broken.


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