You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Michael Xiong (JIRA)" <ax...@ws.apache.org> on 2006/11/01 06:43:31 UTC

[jira] Updated: (AXISCPP-1006) The static const string 's declaration style is not very good(which will cause g++ compiling warning) inside the generated header file

     [ http://issues.apache.org/jira/browse/AXISCPP-1006?page=all ]

Michael Xiong updated AXISCPP-1006:
-----------------------------------

    Attachment: ParmHeaderFileWriter.java

modified src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
to fix this problem

> The static const string 's declaration style is not very good(which will cause g++ compiling warning) inside the generated header file
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXISCPP-1006
>                 URL: http://issues.apache.org/jira/browse/AXISCPP-1006
>             Project: Axis-C++
>          Issue Type: Improvement
>          Components: WSDL processing - RPC, WSDL processing - Doc
>    Affects Versions:  1.6 Beta
>         Environment:     Platform:
>         Linux fedora 3.0
> Axis version:
>         Server-side Axis C++ 1.6Beta
> XML Parser Lib:
> xersesc 2.6
> WSDL2ws tool by using axis java 1.4
> Client-side version Axis java 1.4
> Http Server Version:
> Apache 2.0.53
>            Reporter: Michael Xiong
>            Priority: Minor
>         Attachments: ParmHeaderFileWriter.java, ParmHeaderFileWriter.java
>
>
> I'm using axiscpp1.6-b to develop a web service, and found a minor problem of it's WSDl2Ws tool. Although it only cause a c++ compiling warning when I try to build the generated code by g++, the descipline of my building-system is not allow any compiling warning, so that I can not continue to build it.
> The below is the description of this problem and my solution:
> [problem]
> The generated header file: xxx.hpp has some static constant string definition like the below:
> In FooBar.hpp:
> static const char* Axis_URI_FooBar = "http://www.test.org/FooBar";
> static const char* Axis_TypeName_FooBar = "FooBar";
> This will cause g++ to report compiling warning like:
> warning: ' Axis_URI_FooBar ' defined but not used
> But indeed in FooBar.cpp, the "Axis_URI_FooBar" was actually used.
> [analysis]
> Except for FooBar.cpp, there are also other .cpp files which included FooBar.hpp.
> The "static" means each translation unit (.cpp file) gets its
> own copy of the variable (unless it's a compile-time constant, which it is
> not, because the 'const' is on the left side of the star *).
> So each of the  translation units which included the FooBar.hpp, get a copy of it that they don't use.
> Thus it will cause the above compiling warning.
> [solution]
> I've examined the source code of axiscpp::WSDL2Ws tool, and fixed this problem by modifying the following .java code: inside the writePreprocessorStatements() method.
> src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
> src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
> Detail please refer to the attached .java files.
> The basic idea is to change the declaration style as the below:
> static const char Axis_URI_FooBar[] = "http://www.test.org/FooBar";
> static const char Axis_TypeName_FooBar[] = "FooBar";

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org