From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id 479153858405 for ; Mon, 15 Nov 2021 16:47:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 479153858405 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-f45.google.com with SMTP id d24so32045370wra.0 for ; Mon, 15 Nov 2021 08:47:14 -0800 (PST) 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:references:from:in-reply-to :content-transfer-encoding; bh=Lg1EOFLjE6SqmF0BVQM1blXvWYhVy0bb9mdVer3RB1c=; b=WaQhgd610IQOgvD5k1YxClsoxWIGrEtizhdn22kyFusE8w5I2rvkbMYFAXxpmczfgJ ptiCJLxkoV35k7f8snTfzYcYlMFphueS6pPR+zzAu12itiDYJfzaCFlVYfV8mxINGLZb f+CVHTJDTt/gdc4QrBF41iHYviTmTAlP2EgkZlFHSu2KK6WH+CH7pVFIaJhTqKL5aGzD qgVTBvumT3xW/F/+IhnpidiTsECBVGW21ebCjcy4kvlEcdZC6yBIf1awpTn5TbM/0qLa xrVx944aDsA47lJqsH2qDhfpn8pCjgHBFCmMr+Z0ytfCQ7scyryXonjSpw/c5Yj/5Q8u z3Og== X-Gm-Message-State: AOAM5314TZPt+zQL859YfrsBlNKBw6yc9iGQ9TXP8OpDVbfPUVD4oRyn jM1uJywLCEm1gz+wTeyu8P+SMRmbXP62LA== X-Google-Smtp-Source: ABdhPJwZh0HV+xbNl0MYiZrHvuLrf0KkOz8lU7TzhydGB/ZeexvJr8U1Vd+cpgGErUpRsRqL4Ax3dA== X-Received: by 2002:a5d:53c9:: with SMTP id a9mr465821wrw.119.1636994833343; Mon, 15 Nov 2021 08:47:13 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:fb57:3faf:e98:b979? ([2001:8a0:f912:1a00:fb57:3faf:e98:b979]) by smtp.gmail.com with ESMTPSA id w15sm14821572wrk.77.2021.11.15.08.47.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Nov 2021 08:47:12 -0800 (PST) Message-ID: <02f10a33-9657-5e16-e753-4b0476a4da1d@palves.net> Date: Mon, 15 Nov 2021 16:47:11 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] gdb: fix gdbarch_tdep ODR violation Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org References: <20211112204233.4108340-1-simon.marchi@efficios.com> From: Pedro Alves In-Reply-To: <20211112204233.4108340-1-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 15 Nov 2021 16:47:15 -0000 On 2021-11-12 20:42, Simon Marchi via Gdb-patches wrote: > + aarch64_gdbarch_tdep *tdep > + = (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch); I'd think it would be nicer if we added a small wrapper function to each module, like: static aarch64_gdbarch_tdep * aarch64_gdbarch_tdep (struct gdbarch *gdbarch) { return (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch); } and then we we'd get rid of all the casts and duplicated type names at the callers, like: auto *tdep = aarch64_gdbarch_tdep (gdbarch); That'd essentially require touching again most lines you already touched, so, yeah, for some other rainy day...