On 01-12-16 13:38, Gert Doering wrote:
> On Thu, Dec 01, 2016 at 01:35:49PM +0100, Steffan Karger wrote:
>> On 1 December 2016 at 13:33, Gert Doering <g...@greenie.muc.de> wrote:
>>>    ((uchar *)&c->c2.push_ifconfig_remote_netmask)[0]
>> Looks like dereferencing a type-punned pointer to me ;)
> I was waiting for this :-)
> (...but I thought "char *" is allowed by the rules?)

Heh, and I was worried that you had already though of this, so I must
have been wrong ;)

Indeed, "character types" (including unsigned char) are exempt of the
strict aliasing rules.  C99 6.5:

An object shall have its stored value accessed only by an lvalue
expression that has one of the following types:
— [...], or
— a character type.

Apologies for the noise.


Attachment: signature.asc
Description: OpenPGP digital signature

Openvpn-devel mailing list

Reply via email to