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)
sample file with wrong line numbers
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.
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...
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.