tags:

views:

117

answers:

1

How can I do this:

*(int *)CMSG_DATA(hdr) = fd2pass;

Without GCC raising this:

error: dereferencing type-punned pointer will break strict-aliasing rules

In a way compatible with these options:

-Wall -Werror -pedantic
+2  A: 

Try passing -fno-strict-aliasing to gcc.

To shed a light on the strict aliasing topic, check this question.

Gonzalo
Thanks, Gonzalo. I didn't want to remedy it in the Makefile, since I'm just adding a feature to an existing library, but now that I'm considering it, it doesn't look like a problem.
Phoenix Sol
Ha. Easy. I just need to get over my fear of Makefiles.
Phoenix Sol