[ 
http://issues.apache.org/jira/browse/XERCESC-1444?page=comments#action_12313966 
] 

Axel Weiss commented on XERCESC-1444:
-------------------------------------

It seems that MB_CUR_MAX is not an integer constant expression, and some 
compilers refuse to create arrays of dynamic length on the stack. A quick&dirty 
hack would be to replace MB_CUR_MAX by an integer constant (e.g. 8).

As I will demonstrate soon, the current per-symbol transcode methods in the 
iconv transcoder are rather poorly performing, compared to e.g. the icu 
transcoder. I will propose an improved block-oriented iconv transcoder 
algorithm that outperforms the current solution. This algorithm doesn't need 
MB_CUR_MAX any more, so there's actually no strong demand on finding a clean 
solution here.

Cheers,
                       Axel


> "xercesc/util/Transcoders/Iconv/IconvTransService.cpp", line 414: Error: An 
> integer constant expression is required within the array subscript operator
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: XERCESC-1444
>          URL: http://issues.apache.org/jira/browse/XERCESC-1444
>      Project: Xerces-C++
>         Type: Bug
>   Components: Utilities
>     Versions: Nightly build (please specify the date)
>  Environment: % uname -a
> SunOS merlin.sce.carleton.ca 5.9 Generic_118558-04 sun4u sparc 
> SUNW,Sun-Blade-100
> % which CC
> /opt/SUNWspro/bin/CC
> % 
>     Reporter: Greg Franks
>  Attachments: diff.out
>
> Compiled from
> % svn info
> Path: .
> URL: http://svn.apache.org/repos/asf/xerces/c/trunk
> Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
> Revision: 191274
> Compiling xercesc/util/Transcoders/Iconv/IconvTransService.cpp
> "xercesc/util/Transcoders/Iconv/IconvTransService.cpp", line 414: Error: An 
> integer constant expression is required within$
> 1 Error(s) detected.
> make[2]: *** [xercesc/util/Transcoders/Iconv/IconvTransService.lo] Error 1
> The Sunpro compiler doesn't like MB_CUR_MAX.
>         while (toTranscode[srcCursor])
>         {
>                 char mbBuf[MB_CUR_MAX];
>                 int len = wctomb(mbBuf, toTranscode[srcCursor++]), j;
>                 if (len < 0)
> MB_CUR_MAX is defined in /usr/include/iso/stdlib_iso.h.  I don't know if this 
> should/should not be dragged in automagically based on compiler flags.  I'll 
> poke around a bit more.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to