From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 707F63858D28 for ; Fri, 19 Aug 2022 10:12:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 707F63858D28 Received: by mail-lf1-x12c.google.com with SMTP id d23so1149898lfl.13 for ; Fri, 19 Aug 2022 03:12:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=g8SA5OaNZBpuKzwB5gwZblv4bc6HGcRmV1kmVsxg6wU=; b=7ciSPdhhf1XcvH1De3Gawwu4X2d4wU+2hgWOP7xL4C3WBMMgaSWnTneRVxNyM3cIIG /P9npgHJSk7m+1lGR009Fw7/wLeauhzjcsvZxJa/SowedQvpQWhq0g2KWVLHWZxRl6lq uw/5Txoq4LeThWeaa+oRm6TpGgH9NG5oB/XPJJ1PunXBMujRVE1tk1tCwsAJ6/1FHA8E eQQSrWUUyx+g+mx2mdX3Z8l8XFlMciMLhdSqMj2fz5bYYyeNKFftQ1uvEIgvq8V4hUQg VnpO1dwDWyJ0S+0Pi6JaqqljKfCJHOMQJ9ECSRzwUbi2Ca5sMq/RZ2xsoXTBlKPgATMd 8yyg== X-Gm-Message-State: ACgBeo1Jv0X/YvLCp2jxD66AXIlc9jY0uqKumtGyS/1Djtx/oGNHljK9 +CZ6psbZ1OX27sISP+OCLlkf7V4hHdvoE5u98xcSXZeB X-Google-Smtp-Source: AA6agR5eXA9yZVLnPWAsIFskbv7dofj7P+aM7RMOPuV8/P4ayhGF8O/RNmrEPLI/kkvQYEJPAQkLifMXRZKAnZWFNOY= X-Received: by 2002:a05:6512:3ca8:b0:48b:9ea1:ba with SMTP id h40-20020a0565123ca800b0048b9ea100bamr2112378lfv.202.1660903966609; Fri, 19 Aug 2022 03:12:46 -0700 (PDT) MIME-Version: 1.0 From: Jonas Rahlf Date: Fri, 19 Aug 2022 12:12:35 +0200 Message-ID: Subject: New/improved warning option for padding bytes To: gcc@gcc.gnu.org X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Fri, 19 Aug 2022 10:12:50 -0000 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