From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by sourceware.org (Postfix) with ESMTPS id 0D3F4385734B for ; Wed, 1 Jun 2022 16:38:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D3F4385734B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id q7so3120635wrg.5 for ; Wed, 01 Jun 2022 09:38:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Af+gr4N45VequrFa0Wb8yVyXCm7vi9+y/HRiRtghKlk=; b=O99KCs5W4YnGfxLPhek2TeFfEHtDqbyh8tsCuEuog4WSWuLY/1trTCaXgjauLvxx4x RBEHT467ZotD98t6/nhaO8i5Wn6lAFhInny41ZFcw1JjjxM3h8dIb31BKBpR/vjia80k Qdv6QNhvanYVM060bFww/rLPxnWX6YZnoexFZqnscmxxmzjEiEuOmSix026+2wl2jMqr vle7Ixfo9A7Wljht14IxdEvkLQIT2ZWBuTHRzFDb+iQjzovLhaXrMaxt6vl/aS7sQ2fC 8x7IZsvRhjFXWvsrutVn/CH0mQNifVyeo+U36b+6noLQDcZZqJDi64wZkmOn0irF7sSK xC1w== X-Gm-Message-State: AOAM530NsUEyG6HgUABEEfxwtlzVzpO8QIUg8mSTYWolXzgWrpL+sKEj T4ICEUVJNMhtAknH6KKfyjzEUZuQMnA= X-Google-Smtp-Source: ABdhPJwERZoOR58EuH99370/96eBI5rgBOQ4p5j9HP0077bt9ljEh9JtUSEfhy/1x9b/BAtcaWWCFw== X-Received: by 2002:a5d:4144:0:b0:210:3543:23d9 with SMTP id c4-20020a5d4144000000b00210354323d9mr251965wrq.234.1654101528787; Wed, 01 Jun 2022 09:38:48 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id x8-20020adff0c8000000b00210a6bd8019sm1855869wro.8.2022.06.01.09.38.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jun 2022 09:38:47 -0700 (PDT) Message-ID: <321dffd0-2c41-7c78-a24f-a920ff30afd6@palves.net> Date: Wed, 1 Jun 2022 17:38:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/3] Change location_to_sals to a method Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20220528024231.474534-1-tom@tromey.com> <20220528024231.474534-3-tom@tromey.com> <87a6ax6l75.fsf@tromey.com> From: Pedro Alves In-Reply-To: <87a6ax6l75.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2022 16:38:52 -0000 On 2022-06-01 05:50, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > >>> int thread, task; > > Pedro> These thread/task are masking the breakpoint fields, and then ... > > Ugh, I even looked for this. > > I looked at turning on -Wshadow instead of -Wshadow=local, since that > would fix this problem. It's a bit of a slog, and we'd be at the mercy > of system headers too, but maybe we want to do this? ISTR that we tried -Wshadow early on, and it ran into lots of issues with system headers. Like, e.g., there's a system function named "index" in strings.h, which is easy to run into. And then there were also with issues with variables shadowing functions. ISTR Alan filing a GCC bug about it, to ask to not warn about shadowing system header stuff, or maybe it was about not warning about variables shadowing functions. /me searches. Ah, here, it was actually a GCC fix: https://gcc.gnu.org/legacy-ml/gcc-patches/2011-08/msg02017.html That predates gcc 4.8, I think, our oldest supported GCC version, so we can assume all GCCs have that. OTOH, I'm not sure that patch affects only the C frontend, or whether that code is shared with the C++ frontend. g++ maybe behaves differently, but hopefully not. AFAICS, bfd uses -Wshadow, not -Wshadow=local. Searching in my gdb-patches folder, I found a ton of -Wshadow patches, from Andrey Smirnov from back in 2011. I had forgotten how many those were. It was a series with over 300 patches. I think in the end most were dropped, for handling system header conflicts, which was found not worth it. Maybe we could give -Wshadow another try. > > Meanwhile I filed a gcc feature request to add a new -Wshadow that is > like local but also handles data members: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105798 > > Tom >