http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52499
Bug #: 52499 Summary: avr MODE_CODE_BASE_REG_CLASS enum conversion problem Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: amyl...@gcc.gnu.org Blocks: 44756 Host: x86_64-unknown-linux-gnu Target: avr-elf, avr-rtems gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../../gcc/gcc/caller-save.c -o caller-save.o In file included from ../../../gcc/gcc/caller-save.c:39:0: ../../../gcc/gcc/addresses.h: In function ‘base_reg_class’: ../../../gcc/gcc/addresses.h:31:3: error: enum conversion in return is invalid in C++ [-Werror=c++-compat] cc1: all warnings being treated as errors make[2]: *** [caller-save.o] Error 1 Not sure if "target" is the right category, MODE_CODE_BASE_REG_CLASS is really awkward to define using a function pre-adapted to hookization - the function would be fine for a hook, but if you want to use it in this macro, you'd have to have the macro cast to enum reg_class.