From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,167fc3ed1f7df035 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.233.69 with SMTP id tu5mr1902548pbc.6.1334249109194; Thu, 12 Apr 2012 09:45:09 -0700 (PDT) Path: r9ni48382pbh.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: C's sizeof Date: Thu, 12 Apr 2012 09:43:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <10939468.224.1334249018393.JavaMail.geo-discussion-forums@yngq4> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 X-Trace: posting.google.com 1334249109 23034 127.0.0.1 (12 Apr 2012 16:45:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 12 Apr 2012 16:45:09 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-12T09:43:38-07:00 List-Id: On Thursday, April 12, 2012 9:27:09 AM UTC-7, Simon Wright wrote: > The (draft) ARM Annex B.3[1] says at para 73 - Note 7 - > > "To obtain the effect of C's sizeof(item_type), where Item_Type is > the corresponding Ada type, evaluate the expression: > size_t(Item_Type'Size/CHAR_BIT)." > > Should that not be > > size_t((Item_Type'Size + CHAR_BIT - 1)/CHAR_BIT) > > ? > > [1] http://www.ada-auth.org/standards/12rm/html/RM-B-3.html Does C even support types whose sizes aren't a multiple of a byte? If it doesn't, then since B.3 is talking about the Ada type "corresponding" to a C type, the question is probably moot. -- Adam