mpope@augean.oz.au (Michael T Pope) (10/19/89)
(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