From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D3E6C49ED7 for ; Tue, 10 Sep 2019 16:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3D602082C for ; Tue, 10 Sep 2019 16:46:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XiAF+Ma+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436879AbfIJQqu (ORCPT ); Tue, 10 Sep 2019 12:46:50 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:46459 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436798AbfIJQqt (ORCPT ); Tue, 10 Sep 2019 12:46:49 -0400 Received: by mail-io1-f66.google.com with SMTP id d17so17150042ios.13 for ; Tue, 10 Sep 2019 09:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Iik6ApNStlsVCIULPBT84kpOfksI6a2RGV5x7IOdHNQ=; b=XiAF+Ma+b7DXW8fItPzCAwZV2BY7R6DCjwIU8gP8Czh5N5Bzi1oI3kryFmQEWmzmsw YAdFozCP6YCwgSS00Yxa3TbJw/Dj70Tz+Y2Z8d19BQGeH/nG2g6EnMxU4hEld6iIHkJv KZHBRUp1n7CTdn9jS14c6kt/KPxpAyM71eq7su5HPcVtcq1nieJbPE0l25kuALZJ8PH0 KmgoYk6F+Rd1jxLVxpHp7YX41UOkNzqCdk5FJQhhz23d+n3zE2pQiKHF9E1ZAWtyvx7H Gj5VMzbJVUW+S9yvNDTRsPRGm1UtVBl3kMo5P85s+h12tM8RscgG17XiBELS7f4F20T+ 2mIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Iik6ApNStlsVCIULPBT84kpOfksI6a2RGV5x7IOdHNQ=; b=gSAiFJDx/09tQBBdJbRxcc6LD4UbNECSA7/towk8CHx0jcCYAH8vVA1/xDW2va6pkU UmBFpEFCn9yHcEFg3Q4Wv0PvSNPxwAEjyREMCTHxQjb9MG6TnTdoXEScDOmJl3sgOJUQ 7vv8N18bIArPgizyoCkTkkhwEQSCubcRL3O0qBBh+k73kfET8V+MAdk0/TpQZfs1R1P0 ETrEDrDUEBgDmDY8zpj/y8GsXN5fSGS180b9gvZNck7d+BX/UyXw7bJBHTKGvMgwN8PX ++bfxKyU1M+jeb3SH0v9Sn6k0sIbRP/Wn0ZEoT/MdxFB/hPbfd8m7LfM26rSoC+yhkd6 iQ7Q== X-Gm-Message-State: APjAAAXLniqSbYm6rwRbOmhCTTh5DGL52xwxjGBVCcX6U418D6iCrTOB y0S8gJPdb8wzNF22oxyHYiHbo6pVrgH/BQ5xhJCfOA== X-Google-Smtp-Source: APXvYqzzlqQLEOcmXPHsdz2FVUVRPUyd4sPdSA120DJodf788fo3XDXOGPYeGupwzn0JCBEyQK7AyMUCe7GFjUBZ/Gg= X-Received: by 2002:a02:cad1:: with SMTP id f17mr18966174jap.18.1568134008410; Tue, 10 Sep 2019 09:46:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jim Mattson Date: Tue, 10 Sep 2019 09:46:36 -0700 Message-ID: Subject: Re: [kvm-unit-tests PATCH] x86: setjmp: ignore clang's "-Wsomtimes-uninitialized" flag To: Bill Wendling Cc: kvm list Content-Type: text/plain; charset="UTF-8" Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Sep 9, 2019 at 2:10 PM Bill Wendling wrote: > > Clang complains that "i" might be uninitialized in the "printf" > statement. This is a false negative, because it's set in the "if" > statement and then incremented in the loop created by the "longjmp". > > Signed-off-by: Bill Wendling > --- > x86/setjmp.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/x86/setjmp.c b/x86/setjmp.c > index 976a632..cf9adcb 100644 > --- a/x86/setjmp.c > +++ b/x86/setjmp.c > @@ -1,6 +1,10 @@ > #include "libcflat.h" > #include "setjmp.h" > > +#ifdef __clang__ > +#pragma clang diagnostic ignored "-Wsometimes-uninitialized" > +#endif > + > int main(void) > { > volatile int i; Can we just add an initializer here instead?