------- Comment #29 from alexandre dot nunes at gmail dot com 2007-11-13 17:35 ------- (In reply to comment #28) > (In reply to comment #26) > > (In reply to comment #25) > [cut] > > Mark does not actually read the full list of messages when changing the target > milestone. I think this should be closed as WONTFIX since there is no easy way > to fix this for 4.2 but it is fixed in 4.3. As a workaround, you should be > able > to use -Wno-cast-qual to avoid the warning. > > I don't remember if 4.2 supports -Wno-error=cast-qual. If it does, you can > still get the warning as a warning even when using -Werror. >
It does, thanks for the tip. I added this to my makefile: check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) # Work-around for stupid gcc 4.2 bug ifneq ($(findstring Werror,$(WARN)),) WARN += $(call check_gcc,-Wno-error=cast-qual,) endif ... now it compiles fine with -Werror both on gcc 4.1 and 4.2. It would be nice if this bug would get somehow documented on gcc manual or the main site before gcc 4.2.3 release. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478