From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by sourceware.org (Postfix) with ESMTPS id 667DE3858C56 for ; Thu, 21 Jul 2022 17:06:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 667DE3858C56 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-f48.google.com with SMTP id a5so3135418wrx.12 for ; Thu, 21 Jul 2022 10:06:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0dYUNAZVeiCShZlF8CxGLNkVe7+GwhiuJsyTx/n4tSA=; b=hbXV5CbiEkD8lcQELpzvixSBTc3IWcWAz6EUFVsgflg/mM/Uj2Bjt3KK+y60VZzIL2 brbMoqKenP47yHwzte7/AWQafTE4zfU2SIpvFOE1nlBjf8W/r6wutesg8OB7beu5J+UV 7l4jhdk6G+pENH4VuZlulHxnjp5+/AWsBkT7fzxlyf0NG+8QKmTAokjhN5m7yrfPb7WX CmxQusm1g4RVsM5a5RMeQA4gYczJRIFxmfYjjEEqIVB/rvbfOMxbOsbRGZecxkKtUaoS z8lZzIfeE2PAXzWmE6PMsIRiYo4GpY7BtkG3daZ8B3s4KtXiUkDMSxbpcQzFxY0tVW+9 Hi8g== X-Gm-Message-State: AJIora9WYEl4yU4hJd9gCK3QW39jyKNXckUnZSVu6XggkAO0jDemTOM5 uBFLKEQSS9FeNGDS567REbH0l4vYc4U= X-Google-Smtp-Source: AGRyM1vxIVu1Md2bg4Ns72YQeJyu6OGSdM/wdi4/N5Fqt0gTzkUp5PM/0GZhp7nieE1WFAIMO9XCAw== X-Received: by 2002:a5d:61c3:0:b0:21d:648a:b588 with SMTP id q3-20020a5d61c3000000b0021d648ab588mr34382329wrv.469.1658423157866; Thu, 21 Jul 2022 10:05:57 -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 r17-20020adfe691000000b0020d07d90b71sm2492638wrm.66.2022.07.21.10.05.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 10:05:56 -0700 (PDT) Subject: Re: [PATCH 1/3] struct packed: Use gcc_struct on Windows To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20220721152132.3489524-1-pedro@palves.net> <20220721152132.3489524-2-pedro@palves.net> <83h73amp19.fsf@gnu.org> From: Pedro Alves Message-ID: Date: Thu, 21 Jul 2022 18:05:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <83h73amp19.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.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=no 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: Thu, 21 Jul 2022 17:06:01 -0000 On 2022-07-21 5:03 p.m., Eli Zaretskii wrote: >> From: Pedro Alves >> Date: Thu, 21 Jul 2022 16:21:30 +0100 >> >> The issue is that mingw gcc defaults to "-mms-bitfields", which >> affects how bitfields are laid out. We can however tell GCC that we >> want the regular GCC layout instead using attribute gcc_struct. > > Is that a good idea? It means the code emitted by GCC for this source > file will be incompatible with any other library compiled with MinGW > that GDB uses. So we are risking ABI incompatibilities here. Right? > No. The attribute only changes the layout of that particular structure. > Can you tell why we must have the regular GCC layout of bitfields > here? Because without it the struct won't really be packed.