From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by sourceware.org (Postfix) with ESMTPS id ED317383A37A for ; Thu, 21 Jul 2022 18:30:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED317383A37A 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-f52.google.com with SMTP id k11so3006237wrx.5 for ; Thu, 21 Jul 2022 11:30:26 -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=Z57aRXTqRIivG66FxrIM7CzZaMnmUP2MiSaLL9+yDV8=; b=iYbwPgfNnXJpWG/YYS3Rnis2EfKOwM0eJexdp7J0efKEq5aiamcZaGHwZ6gwbp7vBm weM8fd7BRb83SfVlSszx/pqApIFYGwFtoDZ2YW9NGVrjBhiNy+ZQ/qfSSpi3wTaxv1Kt vlLZsmmfEz1Z6Ttn4k6As7eO5+GBhBk8rl4RI/HWufIw1Z1+v4tB1fSCzngs1qcYHgcS 8aINdhepSqpk46+xV+tEAYyPbB1nQJe36S6FX2oSf/PEd0LTysrsTEU58Fyh00bp67Fq 1hKpnhsid2T415+M1Kwy51L9zvDcJGmTyBrKJYqJLdy4UTAr8OspsWK8tfaBVRzbiG0N 9TWg== X-Gm-Message-State: AJIora8/1Q928tZXMAOv5ZxkIoo4cVvEFM46uo2KLR5xVxgTxwGyI3T6 AulnpAMREgpdz2uNLxHm+6p3Zyj/udE= X-Google-Smtp-Source: AGRyM1t/kb5SemdmmCmeodOs0D4XWvNGSo6OWU12DZGvJ7U5TLHFlc0nDLZYiL/hkN22VQUd5uqnWg== X-Received: by 2002:a5d:5d10:0:b0:21b:9ec1:f4ab with SMTP id ch16-20020a5d5d10000000b0021b9ec1f4abmr15707326wrb.558.1658428225090; Thu, 21 Jul 2022 11:30:25 -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 o20-20020a05600c4fd400b003a305c0ab06sm7159372wmq.31.2022.07.21.11.30.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 11:30:24 -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> <83a692mkj7.fsf@gnu.org> <7b3aa811-a2a8-3b3f-7a6f-40196e4e6901@palves.net> <835yjqmiip.fsf@gnu.org> From: Pedro Alves Message-ID: <2254fb64-63ee-99e4-15d7-24cd411836db@palves.net> Date: Thu, 21 Jul 2022 19:30:23 +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: <835yjqmiip.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 18:30:29 -0000 On 2022-07-21 7:23 p.m., Eli Zaretskii wrote: >> Cc: gdb-patches@sourceware.org >> From: Pedro Alves >> Date: Thu, 21 Jul 2022 19:15:17 +0100 >> >>>> No. The attribute only changes the layout of that particular structure. >>> >>> And we are 110% sure that structure will never be passed to any other >>> code? >> >> What other code are you talking about? struct packed is used in GDB's internal >> structures. Nothing outside GDB ever sees it. GDB doesn't export a C api. >> And if it did, we probably wouldn't use struct packed in exported structures. > > If this is supposed to be based on our vigilance and manual prevention > of exporting it, I think it's fragile and not very reliable. If we > forget or miss something, we get a subtly broken build. > I'm sorry, but this isn't making a lot of sense. If we ever exposed a public C API, we'd have to be very careful with _all_ the types we expose, wrt to ABI stability. >>>>> Can you tell why we must have the regular GCC layout of bitfields >>>>> here? >>>> >>>> Because without it the struct won't really be packed. >>> >>> Can you tell why is that necessary? > > Can you answer this question, please? Yes, sorry, I missed it before. I replied in another email. > > What I'm actually asking is whether there's any alternative which > would avoid overriding the defaults in this matter. > >>> In any case, I'm very uneasy about changes that break ABI >>> compatibility between parts of a program. >> >> But no ABI compatibility is broken. > > But it could be, even if today it isn't. > I could also write a ton of other bugs. What concern is this?