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
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
Try passing -fno-strict-aliasing to gcc.
To shed a light on the strict aliasing topic, check this question.