Message ID | 20180306040220.7519-5-joel@jms.id.au |
---|---|
State | Accepted |
Headers | show
Return-Path: <petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zwNRc1lpdz9sgW for <incoming@patchwork.ozlabs.org>; Tue, 6 Mar 2018 15:03:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ksfh35Aj"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zwNRb747bzF1GF for <incoming@patchwork.ozlabs.org>; Tue, 6 Mar 2018 15:03:23 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ksfh35Aj"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::241; helo=mail-pg0-x241.google.com; envelope-from=joel.stan@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ksfh35Aj"; dkim-atps=neutral Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zwNR40R4HzF1Dr for <petitboot@lists.ozlabs.org>; Tue, 6 Mar 2018 15:02:55 +1100 (AEDT) Received: by mail-pg0-x241.google.com with SMTP id r26so7799235pgv.13 for <petitboot@lists.ozlabs.org>; Mon, 05 Mar 2018 20:02:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=AH5qLvjV+p70dQAuyTNBq0Du/eT/W4ux/WtP71D7I/E=; b=Ksfh35AjhcEX39B1VYG6pwB1ayW36hMj8DAPQLP01yqJ7g3WQkazr1a/fbwIYwAcTR F2JzdP6hhVY2mv2VDedpsAY3FhkfQ5q7cAiQI9+9NTWWenl/ZcmsEilso1mYR4eL/740 3fHkil5+ihDjY02+S8Qe2GPJHvVgTgsnRTRvtSR9eALEIs925mMC7OBg7xM2VHQ7XdLF FPJbzAKSMBTzAZVYA53vjpx7GQzEcei1lNfrkNXfgOFhMh3J9MY1u2jkev6rBOC3lGWd dOS7KIPyfE4jZhYaSdUcnLvCpuQKHEVlmiLoj5C2PwiEN1wuNZnjVUDTFBGcMxeWCYlh xGNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=AH5qLvjV+p70dQAuyTNBq0Du/eT/W4ux/WtP71D7I/E=; b=raDOlg5c0YllzbfzeWSciK8cXRR40xXpWA0ClmBSFXXdNxn7wxfOVY0BEqVTa5tgOR 0Jd/8z/L5qu4zcD7MUJ5LqUs+yeirtcT5ouVrt6VIvtgTWcfv8HVvyWatqU6RoTUbxKB XLJaB6OifkhUQxOvSW5GVdPxnrXgjFfrKp1q9jn9cKUHEL/NuYyk0Ctri5q49DyeztKe gNOITuWdSIvFuSE1ZJNBOT3cwkW/QIwyNT98ZiV15gknFvO8iKCBrbz5fkvhuDTJZjPt W3suVbgUWiXjreEoj/6DXLbA/KvSgi2IkPdbzPGS34L2wgi7A9i46SyNiGIgETId2ttl /kKQ== X-Gm-Message-State: APf1xPCyVPleH2DHEKJftus3zX2RYpbVK0SLYUAUm7WfNvPd7K4Dfvcb utef5Q3vu211fXPn7Aa7sLSm1q2D X-Google-Smtp-Source: AG47ELtaO5Z6D6lCv9sNBBqIkvbjop1+naPzhfW5IB4wd3PshV1Oo2s6gBy+SPQc5yom2nlMPkKT2w== X-Received: by 10.98.150.212 with SMTP id s81mr17870839pfk.100.1520308973578; Mon, 05 Mar 2018 20:02:53 -0800 (PST) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id b88sm28534599pfd.108.2018.03.05.20.02.51 for <petitboot@lists.ozlabs.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Mar 2018 20:02:52 -0800 (PST) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 06 Mar 2018 14:32:48 +1030 From: Joel Stanley <joel@jms.id.au> To: petitboot@lists.ozlabs.org Subject: [PATCH 4/5] test/parser: Fixed uninitialized variable warning Date: Tue, 6 Mar 2018 14:32:19 +1030 Message-Id: <20180306040220.7519-5-joel@jms.id.au> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180306040220.7519-1-joel@jms.id.au> References: <20180306040220.7519-1-joel@jms.id.au> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Petitboot bootloader development <petitboot.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/petitboot>, <mailto:petitboot-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/petitboot/> List-Post: <mailto:petitboot@lists.ozlabs.org> List-Help: <mailto:petitboot-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/petitboot>, <mailto:petitboot-request@lists.ozlabs.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" <petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
Misc fixes
|
expand
|
diff --git a/test/parser/utils.c b/test/parser/utils.c index 8900bd72bebd..47779c86f783 100644 --- a/test/parser/utils.c +++ b/test/parser/utils.c @@ -285,7 +285,7 @@ int parser_replace_file(struct discover_context *ctx, char *buf, int len) { struct parser_test *test = ctx->test_data; - struct test_file *f, *file; + struct test_file *f, *file = NULL; list_for_each_entry(&test->files, f, list) { if (f->dev != dev)
Clang has a problem with list_for_each_entry: test/parser/utils.c:290:36: error: variable 'file' is used uninitialized whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized] list_for_each_entry(&test->files, f, list) { ^ ./lib/list/list.h:30:3: note: expanded from macro 'list_for_each_entry' _pos; _pos = list_next_entry(_list, _pos, _member)) ^~~~ test/parser/utils.c:300:7: note: uninitialized use occurs here if (!file) { ^~~~ test/parser/utils.c:290:36: note: remove the condition if it is always true list_for_each_entry(&test->files, f, list) { ^ ./lib/list/list.h:30:3: note: expanded from macro 'list_for_each_entry' _pos; _pos = list_next_entry(_list, _pos, _member)) ^ test/parser/utils.c:288:28: note: initialize the variable 'file' to silence this warning struct test_file *f, *file; ^ = NULL Signed-off-by: Joel Stanley <joel@jms.id.au> --- This is a general problem that clang has with ccan's list_for_each_entry. I reported it to the maintainer who several months ago said "yeah, we should fix that". test/parser/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)