- Normalize the 'Swig_error' calls and formats, before some

of the strings start like "Error. XXX", others like "XXX".
  The format is now defined in 'error.c:Swig_error_msg_format()'.

- Normalize the multiline error/warning messages to correctly
  use -Fformat definition.

- Centralize the error/warning format definitions in
  'error.c:Swig_error_msg_format()'.

- Fix a minor error in cpp.c, that after finding an error, still
  was emitting a redefined macro, producing duplicated error/warning
  messages in parser.y.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5635 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-01-15 08:33:12 +00:00
commit 48d11474ee
8 changed files with 65 additions and 41 deletions

View file

@ -289,7 +289,7 @@ class Allocate : public Dispatcher {
if (e && is_public(e) && !Getattr(e,"feature:ignore") && (Cmp(symname, Getattr(e,"sym:name")) == 0)) {
Swig_warning(WARN_LANG_DEREF_SHADOW,Getfile(e),Getline(e),"Declaration of '%s' shadows declaration accessible via operator->(),\n",
name);
Swig_warning(WARN_LANG_DEREF_SHADOW,Getfile(c),Getline(c)," '%s' first declared here.\n", name);
Swig_warning(WARN_LANG_DEREF_SHADOW,Getfile(c),Getline(c),"previous declaration of '%s'.\n", name);
} else {
/* Make sure node with same name doesn't already exist */
int k;

View file

@ -252,7 +252,7 @@ int emit_num_required(ParmList *parms) {
p = Getattr(p,"tmap:in:next");
} else {
if (!Getattr(p,"value") && (!Getattr(p,"tmap:default"))) {
Swig_error(Getfile(p),Getline(p),"Error. Non-optional argument '%s' follows an optional argument.\n",Getattr(p,"name"));
Swig_error(Getfile(p),Getline(p),"Non-optional argument '%s' follows an optional argument.\n",Getattr(p,"name"));
}
if (Getattr(p,"tmap:in")) {
p = Getattr(p,"tmap:in:next");

View file

@ -2097,7 +2097,7 @@ int
Language::addSymbol(String *s, Node *n) {
Node *c = Getattr(symbols,s);
if (c && (c != n)) {
Swig_error(input_file, line_number, "Error. '%s' is multiply defined in the generated module.\n", s);
Swig_error(input_file, line_number, "'%s' is multiply defined in the generated module.\n", s);
Swig_error(Getfile(c),Getline(c), "Previous declaration of '%s'\n", s);
return 0;
}

View file

@ -405,8 +405,12 @@ public:
SwigType_typedef_class(fname);
scopename = Copy(fname);
} else {
Swig_warning(WARN_TYPE_REDEFINED,Getfile(n),Getline(n),"Template '%s' was already wrapped as '%s' at %s:%d.\n",
SwigType_namestr(name), SwigType_namestr(Getattr(cn,"name")), Getfile(cn), Getline(cn));
Swig_warning(WARN_TYPE_REDEFINED,Getfile(n),Getline(n),
"Template '%s' was already wrapped,\n",
SwigType_namestr(name));
Swig_warning(WARN_TYPE_REDEFINED,Getfile(cn), Getline(cn),
"previous wrap of '%s'.\n",
SwigType_namestr(Getattr(cn,"name")));
scopename = 0;
}
} else {