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: PATCH RFA: -Wc++-compat warnings for assignments to enum variables


Ian Lance Taylor wrote:
This patch, the next step in my -Wc++-compat work, turns on warnings for
assignments to variables of enum type.

There are two patches here.  The first, smaller, patch enables the
warning.  The main work here is to add a parameter to build_modify_expr,
so that we can emit warnings for assignments to bitfields in structs
with enum type.  The additional parameter is required because at the
point of convert_for_assignment, the original enum type has been
replaced by a bitfield integer type.  This patch requires approval from
the C and C++ frontend maintainers.  Please also take a quick look at
the new test case, and let me know if there are any other cases I should
check.

The second patch fixes all the cases I discovered where this warning is
triggered when bootstrapping gcc.  As before I tested building the arm,
pa, ia64, mips, ppc, s390, sparc, and spu backends.  I verified that
they continued to work the same way on a range of preprocessed test
cases.  This second patch requires approach from the C++, Java, and
Fortran maintainers.  It might be useful for the OpenMP maintainers to
look at the changes to gimplify_omp_for, which were slightly less
mechanical than the other changes.

Bootstrapped and tested on i686-pc-linux-gnu. OK for mainline?

Ian

Fortran parts are Ok. Thanks for working on this (ze dream is aliiive!).


fortran/ChangeLog:

2009-04-22 Ian Lance Taylor <iant@google.com>

	* gfortran.h (enum gfc_symbol_type): New named enum type, broken
	out of struct gfc_symbol.
	(struct gfc_symbol): Use enum gfc_symbol_type.
	(enum gfc_array_ref_dimen_type): New named enum type, broken out
	of struct gfc_array_ref).
	(struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
	(mod_pointee_as): Update declaration.
	* decl.c (add_global_entry): Change type to enum gfc_symbol_type.
	(gfc_mod_pointee_as): Change return type to "match".
	* module.c (mio_array_ref): Add cast to enum type.
	(mio_symbol): Likewise.
	* resolve.c (resolve_global_procedure): Change type to enum
	gfc_symbol_type.
	* trans-io.c (gfc_build_st_parameter): Change type to unsigned
	int.


--
Janne Blomqvist


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