🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #585

Too many warnings

#585
From: Michael T Pope
Date: Thu, 19 Oct 1989 06:28
62 lines
2509 bytes
(Sun-4/Sparc, SunOS 3.?)

G++ 1.36- is a little enthusiastic with its warnings.

-----init.C--------------
typedef void (*vfn)();

class init {
private:  
  int dummy;
public:
  init(vfn v) {
    (*v)();
  }
}; // init

static void foo() {}

static init bar(&foo);
---------------------------------
g++ -v -c -Wall init.C
gcc version 1.36.0- (based on GCC 1.36)
 /usr/local/gnu/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -Wall init.C /usr/tmp/cca01072.cpp
GNU CPP version 1.36
 /usr/local/gnu/gcc-cc1plus /usr/tmp/cca01072.cpp -quiet -dumpbase init.C -Wall -version -o /usr/tmp/cca01072.s
GNU C++ version 1.36.0- (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue -msun-asm
init.C:12: warning: `void foo ()' defined but not used
 /usr/local/gnu/gcc-as -o init.o /usr/tmp/cca01072.s


------------const.C-------------
class foo {
  int bar;
public:
  foo() {}
}; // foo

typedef foo* foo_p;

const foo f;
const foo_p p1 = &f;
foo_p const p2 = &f;
const foo* p3 = &f;
foo* const p4 = &f;
const foo* const p5 = &f;
---------------------------
g++ -c -v -Wall const.C
gcc version 1.36.0- (based on GCC 1.36)
 /usr/local/gnu/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -Wall const.C /usr/tmp/cca01915.cpp
GNU CPP version 1.36
 /usr/local/gnu/gcc-cc1plus /usr/tmp/cca01915.cpp -quiet -dumpbase const.C -Wall -version -o /usr/tmp/cca01915.s
GNU C++ version 1.36.0- (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue -msun-asm
const.C:10: warning: initialization of non-const * pointer from const *
const.C:11: warning: initialization of non-const * pointer from const *
const.C:13: warning: initialization of non-const * pointer from const *
const.C:14: warning: `p5' defined but not used
const.C:12: warning: `p3' defined but not used
const.C:11: warning: `p2' defined but not used
const.C:10: warning: `p1' defined but not used
 /usr/local/gnu/gcc-as -o const.o /usr/tmp/cca01915.s
Technical Details
Message-ID: <8910181458.949@munnari.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!telly!moore!ziebmef!becker!geac!jtsv16!uunet!tut.cis.ohio-state.edu!augean.oz.au!mpope

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!moore!ziebmef!becker!geac!jtsv16!uunet!tut.cis.ohio-state.edu!augean.oz.au!mpope
From: mpope@augean.oz.au (Michael T Pope)
Newsgroups: gnu.g++.bug
Subject: Too many warnings
Message-ID: <8910181458.949@munnari.oz.au>
Date: 19 Oct 89 06:28:30 GMT
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 62