From 7f5145d758ec01f878b459b7a0ab377205d3668c Mon Sep 17 00:00:00 2001 From: Stefan Biereigel Date: Fri, 17 May 2019 15:20:49 +0200 Subject: [PATCH 1/4] emit only warning for primitive redefinition --- pform.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pform.cc b/pform.cc index d93d48659..2467044e6 100644 --- a/pform.cc +++ b/pform.cc @@ -1847,7 +1847,7 @@ void pform_make_udp(perm_string name, list*parms, // Put the primitive into the primitives table if (pform_primitives[name]) { - VLerror("UDP primitive already exists."); + VLwarn("UDP primitive already exists."); } else { PUdp*udp = new PUdp(name, parms->size()); From 0cfb66ecbc05f92bc19cbf06eb8e4d8d0f35696d Mon Sep 17 00:00:00 2001 From: Stefan Biereigel Date: Fri, 17 May 2019 15:22:39 +0200 Subject: [PATCH 2/4] fix warning call --- parse_misc.cc | 4 ++++ parse_misc.h | 1 + 2 files changed, 5 insertions(+) diff --git a/parse_misc.cc b/parse_misc.cc index 2de0dfee1..6f636296e 100644 --- a/parse_misc.cc +++ b/parse_misc.cc @@ -39,6 +39,10 @@ std::ostream& operator << (std::ostream&o, const YYLTYPE&loc) return o; } +void VLwarn(const char*msg) +{ + cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl; +} void VLerror(const char*msg) { diff --git a/parse_misc.h b/parse_misc.h index d02902013..05c35fb01 100644 --- a/parse_misc.h +++ b/parse_misc.h @@ -59,6 +59,7 @@ extern int VLlex(); extern void VLerror(const char*msg); extern void VLerror(const YYLTYPE&loc, const char*msg, ...) __attribute__((format(printf,2,3))); #define yywarn VLwarn +extern void VLwarn(const char*msg); extern void VLwarn(const YYLTYPE&loc, const char*msg); extern void destroy_lexor(); From c6cf83a13a36f504bfda6d3fe5e2b676639507f2 Mon Sep 17 00:00:00 2001 From: Stefan Biereigel Date: Fri, 17 May 2019 16:17:08 +0200 Subject: [PATCH 3/4] make ifnone-error a warning --- parse.y | 2 +- parse_misc.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/parse.y b/parse.y index 76947fd03..510ccd734 100644 --- a/parse.y +++ b/parse.y @@ -5752,7 +5752,7 @@ specify_item pform_module_specify_path(tmp); } | K_ifnone specify_edge_path_decl ';' - { yyerror(@1, "Sorry: ifnone with an edge-sensitive path is " + { yywarn(@1, "Sorry: ifnone with an edge-sensitive path is " "not supported."); yyerrok; } diff --git a/parse_misc.cc b/parse_misc.cc index 6f636296e..cd63a68a5 100644 --- a/parse_misc.cc +++ b/parse_misc.cc @@ -41,13 +41,14 @@ std::ostream& operator << (std::ostream&o, const YYLTYPE&loc) void VLwarn(const char*msg) { - cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl; + warn_count += 1; + cerr << yylloc.text << ":" << yylloc.first_line << ": Warning: " << msg << endl; } void VLerror(const char*msg) { error_count += 1; - cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl; + cerr << yylloc.text << ":" << yylloc.first_line << ": Error: " << msg << endl; } void VLerror(const YYLTYPE&loc, const char*msg, ...) From ca19ebe5d5f0ae722d39f6f8bdd48dadf46613e9 Mon Sep 17 00:00:00 2001 From: Stefan Biereigel Date: Tue, 23 Jul 2019 18:58:20 +0200 Subject: [PATCH 4/4] remove Error:/Warning: prefix from VLerror/VLwarn --- parse_misc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse_misc.cc b/parse_misc.cc index cd63a68a5..5ecffdea1 100644 --- a/parse_misc.cc +++ b/parse_misc.cc @@ -42,13 +42,13 @@ std::ostream& operator << (std::ostream&o, const YYLTYPE&loc) void VLwarn(const char*msg) { warn_count += 1; - cerr << yylloc.text << ":" << yylloc.first_line << ": Warning: " << msg << endl; + cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl; } void VLerror(const char*msg) { error_count += 1; - cerr << yylloc.text << ":" << yylloc.first_line << ": Error: " << msg << endl; + cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl; } void VLerror(const YYLTYPE&loc, const char*msg, ...)