This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]