https://issues.apache.org/bugzilla/show_bug.cgi?id=54468
--- Comment #9 from Chuck Caldarale <chuck.caldar...@unisys.com> --- (In reply to comment #8) > (In reply to comment #7) > > I think you are confused? ctx->context_id is not a pointer but a byte > > array. > context_id is most definitely a pointer to "unsigned char" no matter what > you say. Sorry, that's simply not true. Although the C language automatically casts an array reference to a pointer where appropriate (and sometimes when not), they are semantically different. > sizeof is an aberration in this respect (and documented as such in > Harrison & Steele). It is clearly not an aberration, but rather appropriate use of the sizeof operator (it is _not_ a function). The only mistake I find in the patch is the unnecessary and misleading use of parentheses around the operand, which should only be used when the operand is a type, not a field; since sizeof is an operator, the parentheses are used as in a cast, and should not be used otherwise. > I still think you should use either SHA_DIGEST_LENGTH or even define yet > another constant like TCN_DIGEST_LENGTH to be an alias of SHA_DIGEST_LENGTH. > Using sizeof is misleading at best. Again, I disagree; it is best to use sizeof referencing the target field here since if the field size changes to use a different constant, one does not need to hunt down the all the uses and change them; the revised size is picked up automatically by the sizeof operator. - Chuck -- 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