This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] enum cast fix (svn revision 146752)
- From: Brad Hards <bradh at frogmouth dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 25 Apr 2009 12:05:01 +1000
- Subject: [patch] enum cast fix (svn revision 146752)
Hi,
While building gcc on my fedora 9 (gnu/linux) x86_64 box, I had a compile
problem:
/home/bradh/devel/gcc-svn/host-x86_64-unknown-linux-gnu/prev-gcc/xgcc -B/home/bradh/devel/gcc-svn/host-x86_64-unknown-linux-gnu/prev-gcc/ -B/opt/gccsvn/x86_64-unknown-linux-gnu/bin/ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/bid -I../libdecnumber ../.././gcc/ira.c -o
ira.o
/home/bradh/devel/gcc-svn/host-x86_64-unknown-linux-gnu/prev-gcc/xgcc -B/home/bradh/devel/gcc-svn/host-x86_64-unknown-linux-gnu/prev-gcc/ -B/opt/gccsvn/x86_64-unknown-linux-gnu/bin/ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/bid -I../libdecnumber ../.././gcc/ira-build.c -o
ira-build.o
cc1: warnings being treated as errors
../.././gcc/ira.c: In function âsetup_cover_and_important_classesâ:
../.././gcc/ira.c:763: error: enum conversion in assignment is invalid in C++
Index: gcc/ira.c
===================================================================
--- gcc/ira.c (revision 146752)
+++ gcc/ira.c (working copy)
@@ -760,7 +760,7 @@
break;
if (j < CONSTRAINT__LIMIT)
{
- classes[n++] = i;
+ classes[n++] = (enum reg_class) i;
continue;
}
#endif
[In case of doubt, this patch is deemed trivial. Copyright does not apply to
this change, or if it does, that copyright is to the owners of the copyright
on the patched file.]
Brad