From patchwork Sun Mar 15 20:32:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 131762 X-Patchwork-Delegate: dj@redhat.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id C10A34C3184D for ; Sun, 15 Mar 2026 20:34:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C10A34C3184D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C header.b=Q01kI8DC X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id DB0CB4B1A342 for ; Sun, 15 Mar 2026 20:33:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB0CB4B1A342 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DB0CB4B1A342 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=131.179.128.66 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773606787; cv=none; b=C/EghAFH6U/4pe5gRb3cJ6ad13SjZKn7Gm68N8k7uGF7GXivyicNQDgvYiwuvlwIty3LwZav5xf/DGSAQfPSprMgCyP7S7Vglvt9pagdJf0pQQp4zyofxjQuxHl6hq6Uyh4Z1Sj53hTm14iX/GLtK9aleQI+YefEo4EQ8xGOFB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773606787; c=relaxed/simple; bh=51jcJeO+OUmcnny3hI1J48GFla+3/idAsmCPOKtpTXY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=m54KdWj8kIlMumQtnGK4EyU47KN6ZOOlwJsntVOKTf3gb8CrC84xr5HZRpJmMaMIQyiwp0bH0JhWUBXUb96dlp3LlgOqYhdbxPlZAQj3EtnRUW0k4wdR1cxoVAouPxUbI7wf2FgKsEr2eeK3xDiKtDDOY6F1zdw0a0wBQ5xMGfs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB0CB4B1A342 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 364BD3C005380; Sun, 15 Mar 2026 13:33:06 -0700 (PDT) Authentication-Results: mail.cs.ucla.edu (amavis); dkim=pass (2048-bit key) header.d=cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id ZmjFnukc5DQl; Sun, 15 Mar 2026 13:33:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 0EA313C01EBB7; Sun, 15 Mar 2026 13:33:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 0EA313C01EBB7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1773606786; bh=jipp+RYnYX4tEFiIe+AroM9xJirp2yiTrdSYqrH2blU=; h=From:To:Date:Message-ID:MIME-Version; b=Q01kI8DCT/mBw54VJTJ5TMrKLGRzwtM5Kg/uyo/6e3VjliqbFOk++/LjNUvo90hYr dmMa9AZWQfqn44vzVZ0ZOMw/yj+RXEUTEBNJSfgBrfSLbCGGTQ0o98VF26eKyQCtpK wt4Dm3+S4cnh0e0PhorOIcMLsebVRBx3EitD9abRSjVzNSHBaB6WDxsbebMij4KG/y JPor7FuK2SeOE3tIPMnkTemuO3Fa0Fldy5M9VFHJ2SxbTOAr7rTo8CjzR7G6PHroXv zctlqdEizK4XE4BWcbdVqnQsmHiOuuMvkTdHwam8XTJx+O37Gh9F9wL3xExzTIoDYj WkkEJAJBuHiKA== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id hI2IckxEHn8l; Sun, 15 Mar 2026 13:33:05 -0700 (PDT) Received: from wing.home (47-143-214-216.fdr01.snmn.ca.ip.frontiernet.net [47.143.214.216]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id EA6033C005380; Sun, 15 Mar 2026 13:33:05 -0700 (PDT) From: Paul Eggert To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 1/2] doc: document max_align_t effect on ABI Date: Sun, 15 Mar 2026 13:32:40 -0700 Message-ID: <20260315203255.123865-2-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260315203255.123865-1-eggert@cs.ucla.edu> References: <20260315203255.123865-1-eggert@cs.ucla.edu> MIME-Version: 1.0 X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_EDU_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org * manual/lang.texi (Important Data Types): Say that ABI changes if max_align_t changes. Reviewed-by: DJ Delorie --- manual/lang.texi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manual/lang.texi b/manual/lang.texi index 28e7de2b2c..5f6f74ebb9 100644 --- a/manual/lang.texi +++ b/manual/lang.texi @@ -592,15 +592,21 @@ i.e., the greatest alignment needed by standard types. Code can use @code{alignof (max_align_t)} when calculating space needed for arbitrary collections of objects, so long as the objects' types have a fundamental alignment and lack stricter alignment specifiers. -@end deftp In @theglibc{}, the value of @code{alignof (max_align_t)} is 16 on most architectures. However, it is 8 on 32-bit architectures that do not require 16-byte alignment from @code{malloc} to support predefined types. +Code that uses @code{max_align_t} should take into account the +variable alignment of the type. +For example, it is unwise for a public interface to rely on @code{max_align_t}, +as the interface's ABI can change if a different compiler defines +@code{max_align_t} differently. + @strong{Compatibility Note:} The C11 standard introduced @code{max_align_t}; older compilers may lack the type. +@end deftp @node Data Type Measurements @section Data Type Measurements