This is the mail archive of the gcc-cvs@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]

r222889 - in /trunk/gcc: ChangeLog c-family/Cha...


Author: mpolacek
Date: Thu May  7 19:36:31 2015
New Revision: 222889

URL: https://gcc.gnu.org/viewcvs?rev=222889&root=gcc&view=rev
Log:
	PR c/65179
	* c-common.c (c_fully_fold_internal): Warn when left shifting a
	negative value.
	* c.opt (Wshift-negative-value): New option.
	* c-opts.c (c_common_post_options): Set warn_shift_negative_value
	when -Wextra and C99/C++11 mode.

	* c-typeck.c (build_binary_op): Warn when left shifting a negative
	value.

	* typeck.c (cp_build_binary_op): Warn when left shifting a negative
	value.

	* doc/invoke.texi: Document -Wshift-negative-value.

	* c-c++-common/Wshift-negative-value-1.c: New test.
	* testsuite/c-c++-common/Wshift-negative-value-2.c: New test.
	* testsuite/c-c++-common/Wshift-negative-value-3.c: New test.
	* testsuite/c-c++-common/Wshift-negative-value-4.c: New test.
	* testsuite/c-c++-common/Wshift-negative-value-5.c: New test.
	* testsuite/c-c++-common/Wshift-negative-value-6.c: New test.
	* testsuite/gcc.dg/c90-left-shift-1.c: New test.
	* testsuite/gcc.dg/c99-const-expr-7.c: Add dg-error.
	* testsuite/gcc.dg/c99-left-shift-1.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/Wshift-negative-value-1.c
    trunk/gcc/testsuite/c-c++-common/Wshift-negative-value-2.c
    trunk/gcc/testsuite/c-c++-common/Wshift-negative-value-3.c
    trunk/gcc/testsuite/c-c++-common/Wshift-negative-value-4.c
    trunk/gcc/testsuite/c-c++-common/Wshift-negative-value-5.c
    trunk/gcc/testsuite/c-c++-common/Wshift-negative-value-6.c
    trunk/gcc/testsuite/gcc.dg/c90-left-shift-1.c
    trunk/gcc/testsuite/gcc.dg/c99-left-shift-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-opts.c
    trunk/gcc/c-family/c.opt
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/c99-const-expr-7.c


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