From: Pedro Alves <pedro@palves.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] struct packed: Use gcc_struct on Windows
Date: Thu, 21 Jul 2022 19:30:23 +0100 [thread overview]
Message-ID: <2254fb64-63ee-99e4-15d7-24cd411836db@palves.net> (raw)
In-Reply-To: <835yjqmiip.fsf@gnu.org>
On 2022-07-21 7:23 p.m., Eli Zaretskii wrote:
>> Cc: gdb-patches@sourceware.org
>> From: Pedro Alves <pedro@palves.net>
>> 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?
next prev parent reply other threads:[~2022-07-21 18:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-21 15:21 [PATCH 0/3] struct packed and Windows ports (PR build/29373) Pedro Alves
2022-07-21 15:21 ` [PATCH 1/3] struct packed: Use gcc_struct on Windows Pedro Alves
2022-07-21 16:03 ` Eli Zaretskii
2022-07-21 17:05 ` Pedro Alves
2022-07-21 17:40 ` Eli Zaretskii
2022-07-21 18:15 ` Pedro Alves
2022-07-21 18:23 ` Eli Zaretskii
2022-07-21 18:30 ` Pedro Alves [this message]
2022-07-21 18:45 ` Eli Zaretskii
2022-07-21 18:57 ` Pedro Alves
2022-07-21 18:18 ` Pedro Alves
2022-07-21 18:28 ` Eli Zaretskii
2022-07-21 18:38 ` Pedro Alves
2022-07-21 15:21 ` [PATCH 2/3] struct packed: Unit tests and more operators Pedro Alves
2022-07-21 15:21 ` [PATCH 3/3] struct packed: Add fallback byte array implementation Pedro Alves
2022-07-25 14:58 ` [PATCH 0/3] struct packed and Windows ports (PR build/29373) Tom Tromey
2022-07-25 15:18 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2254fb64-63ee-99e4-15d7-24cd411836db@palves.net \
--to=pedro@palves.net \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).