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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c0fb538211c02258 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: how to know sizeof(int) Date: Thu, 5 Aug 2004 10:14:15 +0200 Organization: Adalog Message-ID: References: <5f59677c.0408040658.5976777a@posting.google.com> <87llguk9k1.fsf@insalien.org> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s5.feed.news.oleane.net 1091696733 2559 195.25.228.57 (5 Aug 2004 09:05:33 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 5 Aug 2004 09:05:33 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:2564 Date: 2004-08-05T10:14:15+02:00 List-Id: "Ludovic Brenta" a �crit dans le message de news:87llguk9k1.fsf@insalien.org... > Indeed, hidden assumptions are evil, and the Enlightened Ones use > System.Storage_Unit instead of just "8". Somehow, "8" is too short to > type and read :) Sure, but we are in a C context here. Try to explain to a C programmer that a byte does not necessarily have eight bits :-) > > Note that sizeof is *not* a regular function (a regular function > > could not have a type as the parameter). It is handled very > > specially in the C compiler, therefore there is no way you could get > > to it from another language. > > I suppose 'Size is also handled specially by Ada compilers, right? All attributes are handled specially of course, but it is explicit. The goal of having a special syntax for attributes is to avoid *hidden* magic, and by the way, it is why it is a good thing that users are not allowed to define their own attributes. It saves you from interesting question like "what happens if a user defines a function called sizeof?". -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr