From patchwork Sat Apr 6 16:58:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masatake YAMATO X-Patchwork-Id: 2402361 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 37388DFB7B for ; Sat, 6 Apr 2013 17:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786Ab3DFRLE (ORCPT ); Sat, 6 Apr 2013 13:11:04 -0400 Received: from h219-110-095-248.catv01.itscom.jp ([219.110.95.248]:53280 "EHLO localhost.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751780Ab3DFRLE (ORCPT ); Sat, 6 Apr 2013 13:11:04 -0400 X-Greylist: delayed 708 seconds by postgrey-1.27 at vger.kernel.org; Sat, 06 Apr 2013 13:11:03 EDT Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost.localdomain (8.14.5/8.14.5) with ESMTP id r36GxOU9003853; Sun, 7 Apr 2013 01:59:24 +0900 Received: (from yamato@localhost) by localhost.localdomain (8.14.5/8.14.5/Submit) id r36GxOa5003852; Sun, 7 Apr 2013 01:59:24 +0900 X-Authentication-Warning: localhost.localdomain: yamato set sender to yamato@redhat.com using -f From: Masatake YAMATO To: linux-sparse@vger.kernel.org Cc: yamato@redhat.com Subject: [PATCH 2/3] Test case for -Winit-cstring option Date: Sun, 7 Apr 2013 01:58:56 +0900 Message-Id: <1365267537-3787-2-git-send-email-yamato@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1365267537-3787-1-git-send-email-yamato@redhat.com> References: <1365267537-3787-1-git-send-email-yamato@redhat.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org This patch added a test case for -Winit-cstring option to validation directory. Signed-off-by: Masatake YAMATO --- validation/init_cstring.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 validation/init_cstring.c diff --git a/validation/init_cstring.c b/validation/init_cstring.c new file mode 100644 index 0000000..00eca20 --- /dev/null +++ b/validation/init_cstring.c @@ -0,0 +1,11 @@ +static struct alpha { + char a[2]; +} x = { .a = "ab" }; +/* + * check-name: -Winit-cstring option + * + * check-command: sparse -Winit-cstring $file + * check-error-start +init_cstring.c:3:14: warning: too long initializer-string for array of char(no space for nul char) + * check-error-end + */