public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* New/improved warning option for padding bytes
@ 2022-08-19 10:12 Jonas Rahlf
  2022-08-21 23:12 ` Eric Gallager
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Rahlf @ 2022-08-19 10:12 UTC (permalink / raw)
  To: gcc

As a firmware developer I would appreciate a warning option about padding
bytes, but only for such cases where you can reduce the number of padding
bytes by rearranging the fields.

The current -Wpadded warns about all padding bytes, which is annoying.

The concept sounds simple: you rearrange all fields from large to small and
check if the size changed.

The goal is to more easily optimize RAM/flash in space constrained systems.

Jonas

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: New/improved warning option for padding bytes
  2022-08-19 10:12 New/improved warning option for padding bytes Jonas Rahlf
@ 2022-08-21 23:12 ` Eric Gallager
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Gallager @ 2022-08-21 23:12 UTC (permalink / raw)
  To: Jonas Rahlf; +Cc: GCC Development

On Fri, Aug 19, 2022 at 6:13 AM Jonas Rahlf via Gcc <gcc@gcc.gnu.org> wrote:
>
> As a firmware developer I would appreciate a warning option about padding
> bytes, but only for such cases where you can reduce the number of padding
> bytes by rearranging the fields.
>
> The current -Wpadded warns about all padding bytes, which is annoying.
>
> The concept sounds simple: you rearrange all fields from large to small and
> check if the size changed.
>
> The goal is to more easily optimize RAM/flash in space constrained systems.
>
> Jonas

That sounds like bug 52981: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52981

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-21 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 10:12 New/improved warning option for padding bytes Jonas Rahlf
2022-08-21 23:12 ` Eric Gallager

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).