Improve typemap method and attribute checking

Specifying a value on the typemap method now gives an error, e.g.:

%typemap(argout=123) char * ""

The old way of specifying a language name in the typemap attributes
is no longer supported (it has been deprecated for 16 years).

Closes #891
This commit is contained in:
Olly Betts 2022-03-03 18:42:20 +13:00
commit 9eb75a0c07
6 changed files with 20 additions and 24 deletions

View file

@ -1,6 +1,7 @@
%module xxx
%typemap(in, numinputs=1, foo) int ""
%typemap(argout=123) char* ""
/* SWIG segfaulted trying to use the above typemap in SWIG < 4.1.0. */
/* SWIG segfaulted trying to use the above in typemap in SWIG < 4.1.0. */
void func(int arg);

View file

@ -1 +1,2 @@
swig_typemap_missing_value.i:3: Error: %typemap argument 'foo' is missing value
swig_typemap_missing_value.i:3: Error: %typemap attribute 'foo' is missing its value. If this is specifying the target language, that's no longer supported: use #ifdef SWIG<LANG> instead.
swig_typemap_missing_value.i:4: Error: %typemap method shouldn't have a value specified.