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: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-20 08:48:52 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.27.83.146!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Fri, 20 Jul 2001 15:47:23 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <5be89e2f.0107170838.c71ad61@posting.google.com> <5be89e2f.0107180235.726d46a8@posting.google.com> <3B55B01A.DAC06D79@icn.siemens.de> <5be89e2f.0107181248.73298c57@posting.google.com> <9j949b$1ujp$1@norfair.nerim.net> <9j983r$20jq$1@norfair.nerim.net> <9j9bdh$22kn$1@norfair.nerim.net> <9j9j37$27qe$1@norfair.nerim.net> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 995644043 29899 217.17.192.37 (20 Jul 2001 15:47:23 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 20 Jul 2001 15:47:23 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:10341 Date: 2001-07-20T15:47:23+00:00 List-Id: * Bertrand Augereau wrote: >> >struct Head >> >{ >> > ... >> > unsigned int offset1:5; >> > unsigned int more_fragments :1; >> > unsigned int dont_fragment : 1; >> > unsigned int pad:1; >> > .. >> >} >> >> What does "Head.more_fragments = (total - send)/packet_size;" mean? > >It is an unsigned int affectation which is undefined if ((total - >send)/packet_size) is bigger than 1 bit, no? What do you expect by reading the source code line? What does really happen? Why can this remain in production software for years? >> >But you have to ensure the previous elements of the structure make the >> >padding right. >> >> No problem. I can live with that (unfortunely, I can't remember the C++ >> language definition specifying that all components must be not aligned but >> packed.) > >I guess bitfields force packing, but I'm not sure. And my Stroustrup's not >there. Else you got me and we have to rely on copmpiler specific stuff. >I'll check. 'guess'. No more questions.