[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marshall McMullen updated ZOOKEEPER-1591:
-----------------------------------------

    Attachment: ZOOKEEPER-1591.patch

This patch removes the unnecessary include of inttypes.h in addrvec.h.

But while I was testing the compilation of this on Linux/Windows, I felt the 
use of the STRUCT_INITIALIZER macro was a *really* bad idea if we want to 
guarantee cross-platform compilation on both Linux and Windows.

Using the C99 struct field initializer extension isn't supported on Windows. If 
we allow that extension to be used at all in the C code then we risk breaking 
compatibility. Because on Linux you could do the assignments out of order from 
the proper order for the structure. This would happily compile on Linux but 
fail on Windows.

The use of the STRUCT_INITIALIZER macro is only going to mask that problem 
rather than enforcing stricter code wherein the order of the fields in the 
assignment must match the order of the fields in the structure.
                
> Windows build is broken because inttypes.h doesn't exist
> --------------------------------------------------------
>
>                 Key: ZOOKEEPER-1591
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1591
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>    Affects Versions: 3.5.0
>         Environment: Windows
>            Reporter: Michi Mutsuzaki
>            Assignee: Marshall McMullen
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1591.patch
>
>
> addrvec.h includes inttypes.h, but it is not present in the windows build 
> environment.
> https://builds.apache.org/job/ZooKeeper-trunk-WinVS2008/596/console
> f:\hudson\hudson-slave\workspace\zookeeper-trunk-winvs2008\trunk\src\c\src\addrvec.h(22):
>  fatal error C1083: Cannot open include file: 'inttypes.h': No such file or 
> directory 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to