From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by sourceware.org (Postfix) with ESMTPS id 1B2C03858C20 for ; Sun, 21 Aug 2022 23:13:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B2C03858C20 Received: by mail-ua1-x930.google.com with SMTP id cd25so3719006uab.8 for ; Sun, 21 Aug 2022 16:13:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=xhpKTOJ4ozgYOzXqN151vS/5J/qpdF8ZvOTlrMhUFQw=; b=4bdqF7h0WR4mPvDgcK0A11Bo5/Jp4F5+yOO6zVEXSDBj0El68+od9BmtesFwMIDtte JYjc1go9pzKZIfm9wDWeEFxa+59xuk1/cJz6/mtIQRGaJJoihRuzRyntjPRVS2F8v800 k6MmMdo0DFZvnG6gia4Xb8pYqN3AlYXE9V5/nJl/8iUxbIwrY1xyddf0G7915c6i8/Io U9iCLtT8GzRFvelq/u9mrk/9jPMgp7gWJUMSwFyZaENaryEVggltSpiZ2/9h2zHHvwfb Ew4ikmq+Xw5vaCL9iCjZ9m+Ynb2MxjbrvuxrVtuFmmoq+L6iPXEJ7z9YuTqrSoAmBClC sH2g== X-Gm-Message-State: ACgBeo3pZ4bRze+J/3zESYo9gb2kgzsN7bZOLQqSml5uBJzb9+ZZYrJ0 sLffKlJ0KJpKEBsH0avG0QiI4+1H816L9NvB6FdVBg== X-Google-Smtp-Source: AA6agR53+CSWtDPCJsFEDZkpZN0xMwcJe7nswYJqM4sOMVBvB9vbfeMg3OJeAizQ7wvcLL/tnk3hHHlYyKf2OOS931k= X-Received: by 2002:ab0:32d3:0:b0:390:e75e:fd4f with SMTP id f19-20020ab032d3000000b00390e75efd4fmr6089590uao.89.1661123579945; Sun, 21 Aug 2022 16:12:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Gallager Date: Sun, 21 Aug 2022 19:12:49 -0400 Message-ID: Subject: Re: New/improved warning option for padding bytes To: Jonas Rahlf Cc: GCC Development Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2022 23:13:02 -0000 On Fri, Aug 19, 2022 at 6:13 AM Jonas Rahlf via Gcc 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