DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6843>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6843

Removal of MSVC copiler warnings

           Summary: Removal of MSVC copiler warnings
           Product: XalanC
           Version: 1.4.x
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: XalanC
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Many of the compiler warnings generates by MSVC are due to unreferenced variables 
(warning 
C4100). These warnings can be rmoved using the following macro
#define XALAN_UNUSED_ARG(a) 
do{} while(&a==0)

and where the warning is issues, the variable responsible for the warning 
should be passed to this macro e.g
void foo(AType* anUnreferencedPtr)
{
  
XALAN_UNUSED_ARG(anUnreferencedPtr);
}

Most compiler optimize this code away (VC++ 
does) and this macro has the advantage of only disabling the warning when it is 
consciently 
removed by the coder (as opposed to using pragmas like #pragma warning (disable:4100) 
which 
remove all warning for the current unit. By using this prama, one runs the risk of 
having an 
unreferenced variable going unoticed).

Reply via email to