#177 Fix compile error when creating long error message

closed-accepted
nobody
None
5
2007-09-18
2007-05-22
No

This patch fixes the bug described in bug 1630855 (https://sourceforge.net/tracker/?func=detail&aid=1630855&group_id=1645&atid=101645).

When SWIG creates a NotImplementedError for overloaded functions, it includes a list of available function prototypes in the error message string. If the number of prototypes is very large, it is possible for the string literal for this message in the generated C++ code to exceed 2048 characters. Visual C++ .NET 2003 is unable to compile code containing a string literal of this length. It halts compilation with an Error C2026 if it encounters such a string. This problem has been encountered when wrapping for both Python and Java.

This patch separates the string into multiple, shorter literals in the generated C++ code. The compiler is now able to compile such code correctly.

Discussion

  • Olly Betts

    Olly Betts - 2007-09-18
    • status: open --> closed-accepted
     
  • Olly Betts

    Olly Betts - 2007-09-18

    Logged In: YES
    user_id=14972
    Originator: NO

    Thanks for your patch - I've applied it to SVN.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks