public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/61294] [4.9 Regression] erroneous memset used with constant zero length parameter warning Date: Mon, 14 Jul 2014 07:37:00 -0000 [thread overview] Message-ID: <bug-61294-4-kXWaw2nnJ8@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-61294-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61294 --- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Jul 14 07:36:39 2014 New Revision: 212510 URL: https://gcc.gnu.org/viewcvs?rev=212510&root=gcc&view=rev Log: PR middle-end/61294 gcc/c-family/ * c.opt (Wmemset-transposed-args): New warning. gcc/c/ * c-parser.c (c_parser_expr_list): Add new argument literal_zero_mask. If non-NULL, call c_parser_check_literal_zero. (c_parser_check_literal_zero): New function. (c_parser_postfix_expression_after_primary): Adjust c_parser_expr_list caller, handle -Wmemset-transposed-args. gcc/cp/ * cp-tree.h (LITERAL_ZERO_P): Define. * parser.c (cp_parser_parenthesized_expression_list): Add want_literal_zero_p argument, if true, for literal zeros insert INTEGER_CSTs with LITERAL_ZERO_P flag set. (cp_parser_postfix_expression): Adjust cp_parser_parenthesized_expression_list caller, handle -Wmemset-transposed-args. (literal_zeros): New variable. gcc/ * doc/invoke.texi (-Wmemset-transposed-args): Document. gcc/testsuite/ * c-c++-common/Wmemset-transposed-args1.c: New test. * c-c++-common/Wmemset-transposed-args2.c: New test. * g++.dg/warn/Wmemset-transposed-args-1.C: New test. Added: trunk/gcc/testsuite/c-c++-common/Wmemset-transposed-args1.c trunk/gcc/testsuite/c-c++-common/Wmemset-transposed-args2.c trunk/gcc/testsuite/g++.dg/warn/Wmemset-transposed-args-1.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c.opt trunk/gcc/c/ChangeLog trunk/gcc/c/c-parser.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/parser.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog
next prev parent reply other threads:[~2014-07-14 7:37 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-05-23 15:29 [Bug c++/61294] New: " orion at cora dot nwra.com 2014-05-26 12:42 ` [Bug c++/61294] " rguenth at gcc dot gnu.org 2014-05-26 12:45 ` rguenth at gcc dot gnu.org 2014-05-26 12:45 ` rguenth at gcc dot gnu.org 2014-05-29 15:46 ` orion at cora dot nwra.com 2014-06-03 13:11 ` [Bug middle-end/61294] " jason at gcc dot gnu.org 2014-06-25 11:37 ` jakub at gcc dot gnu.org 2014-07-14 7:37 ` jakub at gcc dot gnu.org [this message] 2014-07-16 13:29 ` jakub at gcc dot gnu.org 2014-08-06 15:30 ` pinskia at gcc dot gnu.org 2014-10-30 10:40 ` jakub at gcc dot gnu.org 2014-11-24 16:45 ` rguenth at gcc dot gnu.org 2014-11-24 16:50 ` jakub at gcc dot gnu.org 2014-11-24 19:27 ` carlos at gcc dot gnu.org 2014-11-27 5:47 ` siddhesh at redhat dot com 2015-06-26 20:06 ` jakub at gcc dot gnu.org 2015-06-26 20:35 ` jakub at gcc dot gnu.org 2023-03-31 11:42 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-61294-4-kXWaw2nnJ8@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).