Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#954 wrong line numbers in error messages

closed-fixed
5
2010-09-10
2008-10-06
Omni Bee
No

Swig incorrectly reports line numbers in error messages. For example, it reports:

offnums.hpp(30): Error: Syntax error in input(1).

but the input file has only 25 lines.

I used the following command file:

swig -c++ -python offnums.hpp

(no idea if it matters or not)

Discussion

  • Omni Bee
    Omni Bee
    2008-10-06

    sample file with wrong line numbers

     
    Attachments
  • Jon Watte
    Jon Watte
    2008-10-07

    I'm trying to track down a problem as well, and am having a problem I think might be similar, as changing the lines where a syntax error is reported does random things to the error.
    It would be great if the offending line could be printed as well, for manual cross reference.

     
  • Olly Betts
    Olly Betts
    2008-10-08

    I've done some investigation of this and have a patch which works but I have reservations about.

    I've been have trouble submitting it to the tracker as my submission just times out. Let's try
    a comment without the patch first...

     
  • William Fulton
    William Fulton
    2010-09-10

    The line numbering error reporting is now fixed for swig-2.0.1 and was mainly due to the C++ comment after the earlier macro definitions. The attached file now reports:

    offnums.hpp:20: Error: Syntax error in input(1).

    pointing to the first macro statement in the method declaration, which SWIG does not support.

     
  • William Fulton
    William Fulton
    2010-09-10

    • assigned_to: nobody --> wsfulton
    • status: open --> closed-fixed