From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id 206FB3858C56 for ; Thu, 21 Jul 2022 17:40:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 206FB3858C56 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEaA8-0001xO-5P; Thu, 21 Jul 2022 13:40:36 -0400 Received: from [87.69.77.57] (port=1966 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEaA6-0000A5-Nm; Thu, 21 Jul 2022 13:40:35 -0400 Date: Thu, 21 Jul 2022 20:40:28 +0300 Message-Id: <83a692mkj7.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves Cc: gdb-patches@sourceware.org In-Reply-To: (message from Pedro Alves on Thu, 21 Jul 2022 18:05:55 +0100) Subject: Re: [PATCH 1/3] struct packed: Use gcc_struct on Windows References: <20220721152132.3489524-1-pedro@palves.net> <20220721152132.3489524-2-pedro@palves.net> <83h73amp19.fsf@gnu.org> X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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:40:38 -0000 > Cc: gdb-patches@sourceware.org > From: Pedro Alves > Date: Thu, 21 Jul 2022 18:05:55 +0100 > > 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. And we are 110% sure that structure will never be passed to any other code? > > 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? In any case, I'm very uneasy about changes that break ABI compatibility between parts of a program.