This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [C++0x] implementing forward declarations for enums


I had to initialize prevtype variable to make the patch compile:

/home/ed/obj_enumdecl/./prev-gcc/xgcc -B/home/ed/obj_enumdecl/./prev-gcc/ -B/home/ed/bin_enumdecl/x86_64-unknown-linux-gnu/bin/ -B/home/ed/bin_enumdecl/x86_64-unknown-linux-gnu/bin/ -B/home/ed/bin_enumdecl/x86_64-unknown-linux-gnu/lib/ -isystem /home/ed/bin_enumdecl/x86_64-unknown-linux-gnu/include -isystem /home/ed/bin_enumdecl/x86_64-unknown-linux-gnu/sys-include -c -DIN_GCC_FRONTEND -g -O2 -gtoggle -DIN_GCC -W -Wall -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. -Icp -I../../gcc_enumdecl/gcc -I../../gcc_enumdecl/gcc/cp -I../../gcc_enumdecl/gcc/../include -I../../gcc_enumdecl/gcc/../libcpp/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../../gcc_enumdecl/gcc/../libdecnumber -I../../gcc_enumdecl/gcc/../libdecnumber/bid -I../libdecnumber -DCLOOG_PPL_BACKEND ../../gcc_enumdecl/gcc/cp/decl2.c -o cp/decl2.o
../../gcc_enumdecl/gcc/cp/decl.c: In function 'start_enum':
../../gcc_enumdecl/gcc/cp/decl.c:11454:6: error: 'prevtype' may be used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors



tree start_enum (tree name, tree enumtype, tree underlying_type, bool scoped_enum_p, bool *is_new) { tree prevtype = NULL_TREE; gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);

Other than that it looks good to me.

Ed


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