[
https://issues.apache.org/jira/browse/ZOOKEEPER-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13685830#comment-13685830
]
Flavio Junqueira commented on ZOOKEEPER-1679:
---------------------------------------------
Hi Michi,
I have tried your patch with visual studio 2010 and 2012. It fails to build on
both and here is the output:
{noformat}
1>------ Build started: Project: zookeeper, Configuration: Debug Win32 ------
1>Build started 17/06/2013 19:14:43.
1>InitializeBuildStatus:
1> Touching "Debug\zookeeper.unsuccessfulbuild".
1>ClCompile:
1> zk_log.c
1>src\c\include\winconfig.h(187): warning C4005: 'EWOULDBLOCK' : macro
redefinition
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\errno.h(132) : see previous definition of 'EWOULDBLOCK'
1>src\c\include\winconfig.h(188): warning C4005: 'EINPROGRESS' : macro
redefinition
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\errno.h(104) : see previous definition of 'EINPROGRESS'
1>src\c\src\zk_log.c(120): warning C4996: '_snprintf': This function or
variable may be unsafe. Consider using _snprintf_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\stdio.h(363) : see declaration of '_snprintf'
1>src\c\src\zk_log.c(138): error C2143: syntax error : missing ';' before 'type'
1>src\c\src\zk_log.c(140): error C2065: 'pid' : undeclared identifier
1>src\c\src\zk_log.c(142): error C2065: 'pid' : undeclared identifier
1>src\c\src\zk_log.c(146): error C2143: syntax error : missing ';' before 'type'
1>src\c\src\zk_log.c(147): error C2143: syntax error : missing ';' before
'const'
1>src\c\src\zk_log.c(160): error C2143: syntax error : missing ';' before 'type'
1>src\c\src\zk_log.c(165): error C2143: syntax error : missing ';' before 'type'
1>src\c\src\zk_log.c(171): error C2275: 'va_list' : illegal use of this type as
an expression
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\vadefs.h(57) : see declaration of 'va_list'
1>src\c\src\zk_log.c(171): error C2146: syntax error : missing ';' before
identifier 'va'
1>src\c\src\zk_log.c(171): error C2065: 'va' : undeclared identifier
1>src\c\src\zk_log.c(172): error C2065: 'va' : undeclared identifier
1>src\c\src\zk_log.c(172): warning C4047: '=' : 'int' differs in levels of
indirection from 'va_list'
1>src\c\src\zk_log.c(173): error C2065: 'ofs' : undeclared identifier
1>src\c\src\zk_log.c(173): error C2065: 'ofs' : undeclared identifier
1>src\c\src\zk_log.c(173): error C2065: 'va' : undeclared identifier
1>src\c\src\zk_log.c(173): warning C4047: 'function' : 'va_list' differs in
levels of indirection from 'int'
1>src\c\src\zk_log.c(173): warning C4024: 'vsnprintf' : different types for
formal and actual parameter 4
1>src\c\src\zk_log.c(174): error C2065: 'va' : undeclared identifier
1>src\c\src\zk_log.c(174): warning C4047: '=' : 'int' differs in levels of
indirection from 'va_list'
1> mt_adaptor.c
1>src\c\include\winconfig.h(187): warning C4005: 'EWOULDBLOCK' : macro
redefinition
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\errno.h(132) : see previous definition of 'EWOULDBLOCK'
1>src\c\include\winconfig.h(188): warning C4005: 'EINPROGRESS' : macro
redefinition
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\errno.h(104) : see previous definition of 'EINPROGRESS'
1>src\c\src\mt_adaptor.c(119): error C2065: 'zh' : undeclared identifier
1>src\c\src\mt_adaptor.c(119): warning C4047: 'function' : 'const zhandle_t *'
differs in levels of indirection from 'int'
1>src\c\src\mt_adaptor.c(119): warning C4024: 'zoo_get_log_callback' :
different types for formal and actual parameter 1
1>src\c\src\mt_adaptor.c(134): error C2065: 'zh' : undeclared identifier
1>src\c\src\mt_adaptor.c(134): warning C4047: 'function' : 'const zhandle_t *'
differs in levels of indirection from 'int'
1>src\c\src\mt_adaptor.c(134): warning C4024: 'zoo_get_log_callback' :
different types for formal and actual parameter 1
1>src\c\src\mt_adaptor.c(498): warning C4244: '=' : conversion from 'time_t' to
'int32_t', possible loss of data
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.39
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
{noformat}
Any insight here?
> c client: use -Wdeclaration-after-statement
> -------------------------------------------
>
> Key: ZOOKEEPER-1679
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1679
> Project: ZooKeeper
> Issue Type: Improvement
> Components: c client
> Affects Versions: 3.4.5
> Reporter: Michi Mutsuzaki
> Assignee: Michi Mutsuzaki
> Priority: Minor
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1679.patch
>
>
> Visual studio still doesn't support c99.
> --Michi
--
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