Commit graph

124 commits

Author SHA1 Message Date
William S Fulton
efd06d0668 Preprocessing now errors out if extra tokens appear after #else and #end. Add preprocessor errors when preprocessor expressions are missing
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12464 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-16 20:48:48 +00:00
William S Fulton
e0ee14c3ba Fix Fix #1927852 - #include directives don't preprocess the file passed to it
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12457 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-13 13:53:14 +00:00
William S Fulton
16ba0aca53 Fix preprocessor breakages introduced in rev 12441 which was fixing defined() being expanded outside of #if and #elif preprocessor directives
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12455 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-12 23:27:50 +00:00
William S Fulton
63af0a2d72 Fix #1940536, overactive preprocessor which was expanding defined(...) outside of #if and #elif preprocessor directives.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12441 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-07 07:29:55 +00:00
William S Fulton
efb9090a87 Fix correct line number reporting in errors/warnings when a macro definition ends with '/' and it is not the end of a C comment - swig.swg has some of these macro definitions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12215 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-11 11:02:18 +00:00
William S Fulton
f82811dbcd Fix incorrect line number reporting in errors/warnings after parsing macro invocations with parameters given over more than one line.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12214 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-10 23:44:27 +00:00
William S Fulton
122bc852f9 Fix #2149523 - Incorrect line number reporting in errors after parsing macros. Remove extraneous extra line in preprocessed output which would sometimes lead to error/warning messages two lines after the end of the file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12211 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-10 06:08:45 +00:00
William S Fulton
04c3e6b7d3 Fix line numbering for 'Unterminated call invoking macro' error
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12202 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-06 17:30:18 +00:00
William S Fulton
197c8e899d Fix erroneous line numbers in argument count error messages for macro expansions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12201 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-03 18:44:01 +00:00
William S Fulton
a44f83cf05 Fix line numbers in error and warning messages which were accumulately one less than they should have been after parsing each %include/%import - bug introduced in swig-1.3.32. Also fix line numbers in error and warning messages when new line characters appear between the %include / %import statement and the filename.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12199 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-03 06:03:48 +00:00
William S Fulton
aa728ece67 Fix __LINE__ and __FILE__ expansion in macros with no arguments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12197 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-01 21:06:10 +00:00
William S Fulton
31b5f36b74 Fix line number and file name reporting for some macro preprocessor warnings.
The line number of the macro argument has been corrected and the line number
of the start of the macro instead of one past the end is used. Some examples:
  file.h:11: Error: Illegal macro argument name '..'
  file.h:19: Error: Macro 'DUPLICATE' redefined,
  file.h:15: Error: previous definition of 'DUPLICATE'.
  file.h:25: Error: Variable-length macro argument must be last parameter
  file.h:32: Error: Illegal character in macro argument name
  file.i:37: Error: Macro 'SIT' expects 2 arguments

Code used for testing:
// file.h
%define SIT(ax,b)
abc(
%enddef

%define MISSING_DOT1(a,
b,
..)
xxx
%enddef

%define MISSING_DOT2(..)
xxx
%enddef

%define DUPLICATE(a,b)
abc
%enddef

%define DUPLICATE(b)
xxx
%enddef

%define VARARGS_WRONG(a,
x,
...,
 b)
xxx
%enddef

%define BAD_ARGNAME(
a,
b{c
)
xxx
%enddef

SIT(1)


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12195 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-08-29 23:32:49 +00:00
William S Fulton
5a6443ebcf Fix some more instances of __LINE__ and __FILE__ numbering
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12194 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-08-29 22:11:03 +00:00
William S Fulton
69af82caa4 Fix __LINE__ and __FILE__ expansion. Mostly this did not work at all.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12192 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-08-26 18:06:02 +00:00
Olly Betts
bf1d3f0714 Remove superfluous semicolons.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12034 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-21 07:10:12 +00:00
William S Fulton
cb64f65bae SWIG license change - Source moves to GPLv3
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11876 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:53:33 +00:00
William S Fulton
207ba5ce39 Fix #1807329 - When Makefile dependencies are being generated using the -M family of options on Windows, the file paths have been corrected to use single backslashes rather than double backslashes as path separators.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11847 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-08 23:12:27 +00:00
William S Fulton
3932d02a2a fix SWIG naming convention
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-21 00:25:11 +00:00
Haoyu Bai
1d1ee5bae7 Fix broken caused by merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11098 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-01-30 10:32:59 +00:00
Haoyu Bai
47b4825168 Merged revisions 11085-11086,11088-11089 via svnmerge from
https://swig.svn.sourceforge.net/svnroot/swig/branches/swig-2.0

........
  r11085 | bhy | 2009-01-25 00:21:55 +0800 (Sun, 25 Jan 2009) | 2 lines
  
  Fix const-correctness.
........
  r11086 | bhy | 2009-01-25 02:08:50 +0800 (Sun, 25 Jan 2009) | 2 lines
  
  Correct some function definition in header files, which implementation changed in previous commit caused mismatch.
........
  r11088 | bhy | 2009-01-25 02:38:32 +0800 (Sun, 25 Jan 2009) | 1 line
  
  minor fix and now SWIG is alive again
........
  r11089 | bhy | 2009-01-25 06:07:07 +0800 (Sun, 25 Jan 2009) | 1 line
  
  Correct some bug introduced in previous commits. Now SWIG is pretty good with C++ compiler.
........


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11097 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-01-30 10:27:37 +00:00
Haoyu Bai
6d2aef67d9 Replaced all [const] String_or_char * to const_String_or_char_ptr, by the following command:
sed -i "s/\(const \)\?String_or_char \*/const_String_or_char_ptr /g" CParse/* Include/* Modules/* Preprocessor/* Swig/*

This is a preparation for moving to new DOH, since for strong typed objects we need the const_String_or_char_ptr class to implicit convert to and from String * or const char *.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11080 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-01-24 13:15:51 +00:00
William S Fulton
da0b517a7f accept unix directory separators on windows for input file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11001 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-24 14:50:26 +00:00
William S Fulton
49675199f4 Remove some vc++ /W4 warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10540 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-06-21 15:23:02 +00:00
Olly Betts
3777b685a6 Fix many instances of "delimeter" to "delimiter".
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9967 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-10-08 12:02:56 +00:00
William S Fulton
bd0463087c minor bug fix in cpperraswarn pragma and now we error out if SWIG pragma is not recognised
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-07-19 21:51:30 +00:00
Dave Beazley
b92d8e5cff Major overhaul of C/C++ scanner API. Unified tokenizing code so that tokens are scanned by a common code base
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-01-12 19:01:40 +00:00
Dave Beazley
6ffd26cc1e API cleanup. Scanner interface
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9635 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-01-12 01:44:16 +00:00
Dave Beazley
c12550e4ad API cleanup. Documentation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-01-03 05:23:20 +00:00
Dave Beazley
264b7dff90 API cleanup. Documentation.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9629 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-12-30 18:27:47 +00:00
Dave Beazley
54ec9df2ca Changed Header to Id
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9611 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-12-05 22:17:26 +00:00
William S Fulton
a75b902902 add missing new line to warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9527 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-11-06 22:45:31 +00:00
William S Fulton
aa04c4c057 beautify/format source code with gnu indent
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-11-01 23:54:54 +00:00
Olly Betts
1e19f11fdc Use Strchr/strchr instead of Strstr/strstr when searching for a single
character.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9334 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-23 22:36:23 +00:00
William S Fulton
7f74b8e7a3 Common template for head of each file detailing licence, distribution and authors information
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8972 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-03-06 22:51:01 +00:00
Marcelo Matus
97775a5c80 more fixes to use one line macro when possible
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8769 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-10 09:00:00 +00:00
Marcelo Matus
961d9a4e08 more line counting fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-09 20:50:00 +00:00
Marcelo Matus
6e57a9dea4 fix line issues reported by Olly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8743 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-08 01:38:58 +00:00
Marcelo Matus
e70d0e09af better error message for #error exit
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8698 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-03 22:37:55 +00:00
William S Fulton
72f6688a6b gcc-2.96 warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8696 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-03 22:13:07 +00:00
William S Fulton
0b88adaf9d Make default #error behaviour as expected instead of like #warning.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8566 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-26 21:33:15 +00:00
Marcelo Matus
7fafd1b991 fix assert when deleting last_path, not needed anymore
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-26 20:58:19 +00:00
Marcelo Matus
d45400879f quick fix for duplicate keys
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8418 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-13 23:07:15 +00:00
Marcelo Matus
ec64b2ce0d clarify the error message, until we resolve the default behavior
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8313 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-09 01:09:21 +00:00
Marcelo Matus
89e7497ac6 add support for named warning codes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8249 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-06 11:42:24 +00:00
Marcelo Matus
2a3e528169 fixes and docs in %rename
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8160 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-01 11:01:12 +00:00
Marcelo Matus
a0a055ddb9 set cppaswarn as the default
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7938 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-07 07:37:13 +00:00
Marcelo Matus
cb852a98fd use normalized cpperraswarn and nocpperraswarn option instead
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7928 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-05 23:45:10 +00:00
Marcelo Matus
825a0e2685 add code for #errors reported as #warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7927 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-05 22:43:37 +00:00
Marcelo Matus
2acc32946b add option/pragma erroraswarn, which force (or not) to treat the cpp #error directive as a #warning instead
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7926 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-05 22:10:37 +00:00
Marcelo Matus
645f95d633 fix many/many memory leaks
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7904 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-30 21:32:27 +00:00