From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42214 invoked by alias); 20 Jun 2017 13:44:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 42194 invoked by uid 89); 20 Jun 2017 13:44:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.pacific.net From: Rical Jasan To: libc-alpha@sourceware.org Cc: Florian Weimer , Joseph Myers , Zack Weinberg , Carlos O'Donell , Michael Kerrisk Subject: [PATCH v3] manual: Refactor documentation of CHAR_BIT. Date: Tue, 20 Jun 2017 13:44:00 -0000 Message-Id: <20170620134418.31324-1-ricaljasan@pacific.net> In-Reply-To: <20170620112321.29338-1-ricaljasan@pacific.net> References: <20170620112321.29338-1-ricaljasan@pacific.net> X-SW-Source: 2017-06/txt/msg00915.txt.bz2 This single-@item @table is better defined with @deftypevr, since the CHAR_BIT macro has @standards (being declared in a header), and @items in @tables are not considered annotatable. Using @deftypevr automatically includes the macro in the Variable and Constant Macro Index and ensures its inclusion the Summary of Library Facilities. @deftypevr is used to record the type of the macro so that it also appears in the Summary. The description is updated to mention a later POSIX requirement that this macro have the value 8. * manual/lang.texi (CHAR_BIT): Convert from an @table to an @deftypevr. Change standard from ISO to C90. Mention the POSIX.1-2001 requirement of the value 8. --- manual/lang.texi | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/manual/lang.texi b/manual/lang.texi index c4b641d4e1..75af677dc9 100644 --- a/manual/lang.texi +++ b/manual/lang.texi @@ -628,11 +628,10 @@ There is no operator in the C language that can give you the number of bits in an integer data type. But you can compute it from the macro @code{CHAR_BIT}, defined in the header file @file{limits.h}. -@table @code -@item CHAR_BIT -@standards{ISO, limits.h} -This is the number of bits in a @code{char}---eight, on most systems. -The value has type @code{int}. +@deftypevr Macro int CHAR_BIT +@standards{C90, limits.h} +This is the number of bits in a @code{char}. POSIX.1-2001 requires +this to be 8. You can compute the number of bits in any data type @var{type} like this: @@ -640,7 +639,7 @@ this: @smallexample sizeof (@var{type}) * CHAR_BIT @end smallexample -@end table +@end deftypevr That expression includes padding bits as well as value and sign bits. On all systems supported by @theglibc{}, standard integer types other -- 2.12.2