From patchwork Fri Oct 12 03:03:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sebor X-Patchwork-Id: 982827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-487414-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wzsg0owI"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SvPO2EW3"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42WXj13l8fz9s55 for ; Fri, 12 Oct 2018 14:03:33 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Rq8NrqBgOOtKrygToOfCozbYxdXbvnOmgL++Kk98xxmOCeKeD7 4Oiq7bovVujdaqLUtBHRLkQUNMFA7shLTKUR8lCyrZlOJ9odNFEY9A8aH/vaDy8K Au35Rkfwi4prixNLBFLegulHi025oajVPQgJ/QENoz2SMP2NXMpzkYVYc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=kbpV8/atApGptqeutjOu357x9LA=; b=wzsg0owIfYYop0sISkVP fESg0BJW8uEGS/CyHhREiVWZIBBQlqGmeWEvfG+FzJms0C5asHfbeNMBH/L3WLw+ MqORtjv4XCOvlaBxobvd4Y0AxzovMlNtkaH+WSrzx/XFMqyaCcOQ8IE/FBiWZy23 IyCVaXfSVBxauIM8k+rEnn4= Received: (qmail 2530 invoked by alias); 12 Oct 2018 03:03:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2504 invoked by uid 89); 12 Oct 2018 03:03:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:d124-v6, honor X-HELO: mail-qk1-f174.google.com Received: from mail-qk1-f174.google.com (HELO mail-qk1-f174.google.com) (209.85.222.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Oct 2018 03:03:24 +0000 Received: by mail-qk1-f174.google.com with SMTP id q12-v6so6855586qkl.13 for ; Thu, 11 Oct 2018 20:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version; bh=GJQno5LnuuGSEZy6QumDs0ssSFkPr/zGtYrA2TIQ5hI=; b=SvPO2EW3Hx69aw6MMLVHt/eQvrR75o7MoSFoDGJ+NB6xZY6j7d0N2Xs5eUntssJerV +YBSj2t35WTx39Z2/R6q8ojDN/idQ2Pgvu6N3ACXT/NuOQFxdKUH5Unv4AFHMv9oSP0M pB5GaOlLgRNsUpDs1a3f0r458Q1iJkX6JN6EiqTAK/9pW2fdYAJ+Qo8RTau1MqECNWVC jE00Zq0EdYfaqXy8XoqZ++uPl3ExNPkJQ1+vZL9vT8+jQiMG70w/aA1MKDHdKwkXaVTw sagFa+kaWocqKqnN310yqT8S7KehWt/JgkjpDFOAUpudrAV5A0OQYRyQOCmMHsb0Imcm 2TSQ== Received: from localhost.localdomain (184-96-225-137.hlrn.qwest.net. [184.96.225.137]) by smtp.gmail.com with ESMTPSA id t41-v6sm4379448qte.95.2018.10.11.20.03.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Oct 2018 20:03:21 -0700 (PDT) To: Gcc Patch List From: Martin Sebor Subject: [doc PATCH] attribute packed does not apply to variables Message-ID: <2aff3854-915c-47ba-b672-15a5c639c87e@gmail.com> Date: Thu, 11 Oct 2018 21:03:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-IsSubscribed: yes The manual says that: The packed attribute specifies that a variable or structure field should have the smallest possible alignment--one byte for a variable, and one bit for a field... The variable part doesn't actually reflect reality: GCC and all other compilers I tested ignore the attribute with a warning on non-member objects, and only honor it on members. The part that reads "and one bit for a field" is also incorrect: it most likely meant to say bit-field. The attached change fixes both of these issues. Martin gcc/ChangeLog: * doc/extend.texi (attribute packed): Correct typos. Index: gcc/doc/extend.texi =================================================================== --- gcc/doc/extend.texi (revision 265073) +++ gcc/doc/extend.texi (working copy) @@ -6220,13 +6220,13 @@ int f (struct Data *pd, const char *s) @item packed @cindex @code{packed} variable attribute -The @code{packed} attribute specifies that a variable or structure field -should have the smallest possible alignment---one byte for a variable, -and one bit for a field, unless you specify a larger value with the -@code{aligned} attribute. +The @code{packed} attribute specifies that a structure member should have +the smallest possible alignment---one one bit for a bit-field and one byte +otherwise, unless a larger value is specified with the @code{aligned} +attribute. The attribute does not apply to non-member objects. -Here is a structure in which the field @code{x} is packed, so that it -immediately follows @code{a}: +For example in the structure below, the member array @code{x} is packed +so that it immediately follows @code{a} with no intervening padding: @smallexample struct foo