>Yes you can, in modern variants of C. Are you using an old compiler? I'm using Microsoft Visual Studio 2005, Version 8.
You are correct, Microsoft does not have full support for C99, which I believe is the C conformance spec that allows mid-scope declarations. Microsoft will likely never support this, so if we want to support MS compilers, we can't have mid-scope declarations in C code (note that a previous email indicated this has already been fixed in the source code). The only info from Microsoft I've found on C99 support: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=345360 Hi: unfortunately the overwhelming feadback we get from the majority of our users is that they would prefer that we focus on C++-0x instead of on C-99. We have "cherry-picked" certain popular C-99 features (variadic macros, long long) but beyond this we are unlikely to do much more in the C-99 space (at least in the short-term). Jonathan Caves Visual C++ Compiler Team. -----Original Message----- From: Haszlakiewicz, Eric [mailto:ehas...@transunion.com] Sent: Thursday, July 09, 2009 2:49 PM To: Apache AXIS C Developers List Subject: RE: code generated from WSDL2C doesn't compile ... not valid C code >-----Original Message----- >From: Patrick Cosmo [mailto:pco...@incognito.com] The following >generated code is not valid C code because it does not declare all >variables at the top of the scope: > >------------- code generated from WSDL2C starts here >----------------------------- >else >{ > axiom_node_t *text_node = NULL; > text_node = axiom_node_get_first_child(parent, env); > axiom_text_t *text_element = NULL; > >------------- code generated from WSDL2C ends here >----------------------------- > > >The last line above is wrong - you can't declare a variable at that >point in C. Yes you can, in modern variants of C. Are you using an old compiler? Note that there are probably other features of modern C that are used in the code, such "//" style comments, that old compiler would complain about. What vintage of compilers is axis2/c targeting/supporting? eric