This is the mail archive of the gcc-help@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]

Re: -Weffc++ and STL



I use the -Weffc++ option and the following long grep command to
eliminate warnings from the STL headers.  What you see here is part of
a makefile.  file.flint.o is the standard output of the compiler with
almost all warnings options turned on.  file.lint.o holds just those
warnings or errors that I want to see.

%.lint.o: %.flint.o
	-grep -v \
	  -e '/usr/stow/egcs' \
	  -e '/usr/stow/gcc' \
	  -e '/usr/local/include' \
	  -e 'instantiated from' \
	  -e '^        ' \
	  -e 'At top level' \
	  -e '^In instantiation of' \
	  -e '^In file included from' \
	  -e '__deque_iterator' \
	  -e '__list_iterator' \
	  -e '__default_alloc_template' \
	  -e '_Deque_base' \
	  -e '_Deque_alloc_base' \
	  -e '_Deque_iterator' \
	  -e '_List_base' \
	  -e '_List_alloc_base' \
	  -e '_List_iterator' \
	  -e '_Vector_base' \
	  -e '_Vector_alloc_base' \
	  -e '_Vector_iterator' \
	  -e 'In function' \
	  -e 'In method' \
	  -e 'In instantiation of' \
	  $< > $@



"Andy Glew" <aglew@students.wisc.edu> writes:
> I'd like to try using the -Weffc++ flag - enforcing
> Scott Meyer's style - but when I enable it it
> reports warnings all over the place inside the STL.
> 
> Example warnings at bottom of this message.
> 
> Q: is there any way that I can enable this warning just for my code,
> and disable it for <library> headers?
> 
> 
> 
> 
> In file included from /s/gcc-2.95/sunx86_56/lib/gcc-lib/i386-pc-solaris2.6/2.95/../../../../include/g++-3/stl_algobase.h:53,
>                  from /s/gcc-2.95/sunx86_56/lib/gcc-lib/i386-pc-solaris2.6/2.95/../../../../include/g++-3/queue:30,
>                  from sim-ag.cc:35:
> /s/gcc-2.95/sunx86_56/lib/gcc-lib/i386-pc-solaris2.6/2.95/../../../../include/g++-3/iostream.h:112: warning: `class ostream' has
> pointer data members
> /s/gcc-2.95/sunx86_56/lib/gcc-lib/i386-pc-solaris2.6/2.95/../../../../include/g++-3/iostream.h:112: warning:   but does not override
> `ostream(const ostream&)'
> 
> 

-- 
Fred Wheeler
wheeler (at) cipr.rpi.edu
www.cipr.rpi.edu/wheeler


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