From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115981 invoked by alias); 18 May 2017 11:51:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 115294 invoked by uid 89); 18 May 2017 11:51:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=thatd, that'd, 5.3 X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 May 2017 11:51:43 +0000 Received: by mail-wm0-f49.google.com with SMTP id b84so198834052wmh.0 for ; Thu, 18 May 2017 04:51:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=qFE6B4tHEIYi/VsyZpIgyWXRqNgeKlBWeI8gxdaw25g=; b=VS3pGR3K2DXDDiE+7tnv0awNojiLt4wpEeJkdKyjaawLf7KjMEBVgZaVoMwsK9vTOE jrOE/U3fmw1q8Z/SU5XL67ZHOPSOUc46yJvnx+9CzI0RRUo9TxtvVwWpWrhXkLyd1WbB sjOSFQjdDe3bRQSupZbHa5+ZxH/noUZmTOcHpNS6Pn7BiIdwcEfiTlPB/5mG9W8j+Qtn 6NC6ZglgKZHt8TsOgSC6ntVcWpctu07AuYX6UksALDqnNjxQVvcUpyyxvmKIZNW2XkdL Myt+6JxQPitulpbA9CWhUvjqYt4zYcR9oGKvIyhR2UkTcBSAgtzXRgP4tDNtTpTrEW+A ePXg== X-Gm-Message-State: AODbwcCMbztAVpJJmh/WqeeGs1+BaVdgO1mtt2hHB4RTcam+GemaStVC CQG5vRQms9ODptcQ X-Received: by 10.28.4.216 with SMTP id 207mr15486188wme.142.1495108304940; Thu, 18 May 2017 04:51:44 -0700 (PDT) Received: from [192.168.0.102] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id f25sm7128360wrf.13.2017.05.18.04.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 04:51:44 -0700 (PDT) Subject: Re: [PATCH OBV] Add nowarnings in gdb.base/fileio.exp To: Yao Qi References: <1495028758-13982-1-git-send-email-yao.qi@linaro.org> <684aa647-c1f4-e0cb-c4d5-04bd55463e20@redhat.com> <86fug28sxu.fsf@gmail.com> <9eedfbd7-9f36-2fe4-7a13-00e0b2261629@redhat.com> <8637c28krq.fsf@gmail.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <46e0931c-1c64-eaa4-3811-f6c30af545d2@redhat.com> Date: Thu, 18 May 2017 11:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <8637c28krq.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg00419.txt.bz2 On 05/18/2017 12:30 PM, Yao Qi wrote: > Pedro Alves writes: > >> I don't think so. I think that'd be the equivalent of saying that we >> don't support debugging target code built with gcc versions earlier >> than 4.6. That's a totally different discussion from the discussion >> about requirements for building gdb. > > That is what I meant by "require gcc 4.6 to run testsuite". If we use > such diagnostic in tests, we need gcc 4.6 or later to compile gdb test > cases. Right, and I was replying to your "I am OK with this requirement." by explaining why I don't think it's an OK requirement. I knew that "#pragma GCC diagnostics ignored -Wwhatever" ignores unknown warnings, and I thought that older GCCs just ignored unknown #pragmas, but that's not actually true -- I tried it with gcc 3, and "-Wall" makes it warn about unrecognized pragmas. So I got confused for a while when you said the "diagnostic" was added in gcc 4.6. The warning (the diagnostic) is much older than gcc 4.6. What I think was added in gcc 4.6 was "#pragma GCC diagnostic push/pop". This means that we wrap the "#pragma GCC diagnostic ignore" under a gcc 4.6 check, we'd still get a warning with older compilers. Only with -Wall though, so maybe it was still OK. BTW, what compiler are you testing with that enables -Wnonnull by default? >> How about an even simpler fix: pass a global pointer variable that >> happens to be NULL to stat, instead of a NULL literal. The compiler can't >> prove (without LTO) that the variable may still be NULL, so it doesn't >> warn. Works on all compilers I tried it on: gcc 3.4/5.3/7, clang 3.7. >> >> Let me send a mini series in reply to this email, which does that, >> and also fixes a few other warnings that compiling the fileio.c with >> -Wall exposes. > > These three patches are good to me. I'll push them in in a bit. Thanks, Pedro Alves