[Bug middle-end/61018] [4.8/4.9/5 Regression] -Wvarargs does not print warning for member functions

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 9 17:38:00 GMT 2014


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);
}



More information about the Gcc-bugs mailing list