This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc 3.0.2 -Wall complains about uses of member function named sscanf
- From: "Robert R. Henry" <rrh at cray dot com>
- To: bug-gcc at gnu dot org
- Date: Mon, 3 Jun 2002 15:44:39 -0700 (PDT)
- Subject: gcc 3.0.2 -Wall complains about uses of member function named sscanf
g++ -v:
Reading specs from /opt/CRAYfw/gcc/3.0.2/lib/gcc-lib/sparc-sun-solaris2.8/3.0.2/specs
Configured with: ./configure --prefix=/opt/CRAYfw/gcc/3.0.2
Thread model: posix
gcc version 3.0.2
For the program at the end of this note reports:
g++ -Wall -c x.cc
x.cc: In function `int mumble()':
x.cc:12: warning: format argument is not a pointer (arg 3)
x.cc:13: warning: format argument is not a pointer (arg 3)
x.cc:13: warning: too many arguments for format
gcc should not be making assumptions that a member function named sscanf
in a class that I define has semantics like that of the global
function sscanf.
For this program:
class Scanf {
public:
static int sscanf(const char *buf, const char *fmt,
const int &x);
static int sscanf(const char *buf, const char *fmt,
const int &x, const int &y);
};
int mumble(void)
{
int val;
Scanf::sscanf("17", "%d", val);
Scanf::sscanf("17", "%d", val, val);
return 0;
}