cfengine/core — pull request #287 by mvpel (2013-01-10 02:23:56+00:00)
Title: Eliminate spurious type-pun warning during HP-UX GCC build.

https://cfengine.com/dev/issues/1802

While the HP-UX "fd_set" type is defined in /usr/include/sys/_fd_macros.h as a struct of an array of "long" values in accordance with the XPG4 standard's requirements, the macros for the FD operations "pretend it is an array of int32_t's so the binary layout is the same for both Narrow and Wide processes," as described in _fd_macros.h. In the FD_SET, FD_CLR, and FD_ISSET macros at line 101, the result is cast to an "__fd_mask *" type, which is defined as int32_t at _fd_macros.h:82.

This conflict between the "long fds_bits[]" array in the XPG4-compliant fd_set structure, and the cast to an int32_t - not long - pointer in the macros, causes a type-pun warning if -Wstrict-aliasing is enabled. The warning is merely a side effect of HP-UX working as designed, so it can be ignored.

This replaces commit cef42008f6ffb606b848395e86d70376eef80836, submitted as [pull request 258](https://github.com/cfengine/core/pull/258) (since withdrawn), following [vohi](https://github.com/vohi)'s suggestion to use "#pragma GCC" instead of a #warning.