add support for named warning codes

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8249 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-06 11:42:24 +00:00
commit 89e7497ac6
124 changed files with 671 additions and 281 deletions

View file

@ -1581,7 +1581,11 @@ Preprocessor_parse(String *s)
while (*c && (isspace((int)*c))) c++;
if (*c) {
if (strncmp(c,"nowarn=",7) == 0) {
Swig_warnfilter(c+7,1);
String *val = NewString(c+7);
String *nowarn = Preprocessor_replace(val);
Swig_warnfilter(nowarn,1);
Delete(nowarn);
Delete(val);
}
else if (strncmp(c,"cpperraswarn=",7) == 0) {
error_as_warning = atoi(c+13);

View file

@ -173,10 +173,20 @@ Swig_error_silent(int s) {
void
Swig_warnfilter(const String_or_char *wlist, int add) {
char *c;
char *cw;
String *s;
if (!filter) filter = NewStringEmpty();
s = NewString(wlist);
s = NewString("");
Clear(s);
cw = Char(wlist);
while (*cw != '\0') {
if (*cw != ' ') {
Putc(*cw, s);
}
++cw;
}
c = Char(s);
c = strtok(c,", ");
while (c) {