Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.c.moderated > #470

Re: Portable/strictly conforming alternative to the "struct hack" (?)

From Jasen Betts <jasen@xnet.co.nz>
Newsgroups comp.lang.c.moderated
Subject Re: Portable/strictly conforming alternative to the "struct hack" (?)
Date 2013-09-11 17:26 -0500
Organization JJ's own news server
Message-ID <clcm-20130911-0001@plethora.net> (permalink)
References <clcm-20130902-0003@plethora.net> <clcm-20130906-0001@plethora.net>

Show all headers | View raw


On 2013-09-07, Jasen Betts <jasen@xnet.co.nz> wrote:
> On 2013-09-02, Árpád Goretity <arpad.goretity@gmail.com> wrote:

>>     typedef struct Header {
>>         size_t length;
>>         /* other members follow */
>>     } Header;

>>     size_t n_hdr = (sizeof(Header) + sizeof(Value) - 1) / sizeof(Value);
>
> that n_hdr expression looks kind of dodgy, basically it evaluates to 1, 
> anyone who goes to such lengths to caclulate 1 is unlikley to have
> discovered something special. After that  I stopped trying to understand 
> your code

I am of course wrong - having ignored the "/* other members follow */"
comment. sorry.


-- 
⚂⚃ 100% natural

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.

Back to comp.lang.c.moderated | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Portable/strictly conforming alternative to the "struct hack" (?) Árpád Goretity <arpad.goretity@gmail.com> - 2013-09-02 04:08 -0500
  Re: Portable/strictly conforming alternative to the "struct hack" (?) Jasen Betts <jasen@xnet.co.nz> - 2013-09-06 23:24 -0500
    Re: Portable/strictly conforming alternative to the "struct hack" (?) Jasen Betts <jasen@xnet.co.nz> - 2013-09-11 17:26 -0500
      Re: Portable/strictly conforming alternative to the "struct hack" (?) Árpád Goretity <arpad.goretity@gmail.com> - 2013-10-03 13:37 -0500
        Re: Portable/strictly conforming alternative to the "struct hack" (?) Keith Thompson <kst-u@mib.org> - 2013-10-08 16:38 -0500

csiph-web