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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-19 11:15:00 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail From: Michael Rubenstein Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Date: Sun, 19 Aug 2001 14:14:08 -0400 Message-ID: <6mtvntg46hiniqi6bq3m60987ta85ru3st@4ax.com> References: <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <3B6F312F.DA4E178E@home.com> <23lok9.ioi.ln@10.0.0.2> <3B70AB15.35845A98@home.com> <3B721FF5.B7D854F6@home.com> <3B7BC847.61D7EF55@home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: UmFuZG9tSVb68xOoEcMRop8AFdGTlip664KDIb+v2X3NNEQsVgPB3YwHzoOLZMqimJdfvKow3Sw= X-Complaints-To: abuse@rcn.com NNTP-Posting-Date: 19 Aug 2001 18:14:09 GMT X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:12105 comp.lang.c:75416 comp.lang.c++:83935 Date: 2001-08-19T18:14:09+00:00 List-Id: On Thu, 16 Aug 2001 17:31:06 GMT, kaz@ashi.footprints.net (Kaz Kylheku) wrote: >In article <3B7BC847.61D7EF55@home.com>, Warren W. Gay VE3WWG wrote: >>David Thompson wrote: >>> Warren W. Gay VE3WWG wrote : >>> ... >>> > I wasn't talking abuse. On 5 different platforms, the sizeof "ab" could >>> > yeild the answers 3,4 or 8, depending upon the platforms chosen ;-) >>> > This is not a very good result for such a simple compiler request. >>> > >>> Not true. In any conforming implementation of either C or C++ >>> sizeof "ab" is 3. Perhaps you meant one of two other things: >> >>Maybe that's now true with the C99 standard. But it is definitely > >sizeof "ab" == 3 is a C89 feature. I don't have a copy of K&R 1978 >but I'd be surprised if it did not document this as well. Not quite. K&R 1978 didn't require that sizeof(char) == 1 (though I've never heard of an implementation in which it was not), so sizeof "ab" could be larger than 3. However, it did require that sizeof return the number of bytes, so sizeof("ab") did have to be a multiple of 3. From K&R 1978 7.2: The sizeof operator yields the size, in bytes, of its operand. (A byte is undefined by the language except in terms of the value of sizeof. However, in all existing implementations a byte is the space required to hold a char.) When applied to an array, the result is the total number of bytes in the array. -- Michael M Rubenstein