https://issues.apache.org/bugzilla/show_bug.cgi?id=54468

--- Comment #3 from William A. Rowe Jr. <wr...@apache.org> ---
You are suggesting C (C++) can morph the sizeof(str1) member when
it is explicitly declared?  I think not...

struct {
    char str1[5];
    int  inta[4];
}

any more than it would be allowed to morph the sizeof(str1) here;

union {
    char  str1[5];
    int   inta[4];
    ulong uv;
}

You are confusing the sizeof operator with explicitly computing member offsets;
ssize_t mbroffset = ((char*) x.inta[0] - (char*) x.str1[0])
which would, as you pointed out in comment #2, return something more like '8'
such that inta remains int-aligned.

In any case, the reason for performing something like memcpy(x, sizeof(x)...
is that construct isn't subject to being patched again.  The context_id member
can be changed again and again without mauling that code anymore.  I prefer the
patch as submitted, for clarity.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to