summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analysis/analysis.cpp3
-rw-r--r--src/logger.cpp6
-rw-r--r--src/logger.h5
3 files changed, 9 insertions, 5 deletions
diff --git a/src/analysis/analysis.cpp b/src/analysis/analysis.cpp
index ca689e1..3d7a9de 100644
--- a/src/analysis/analysis.cpp
+++ b/src/analysis/analysis.cpp
@@ -110,7 +110,8 @@ void reportParmDeclNullPointer(Node *mainNode,
if (wi.checkNullVars.find(node->label) != wi.checkNullVars.end())
{
Log::warn(findBackLocation(mainNode),
- "Using variable without check for NULL");
+ "Using parameter '%s' without checking for null pointer",
+ node->label);
}
}
}
diff --git a/src/logger.cpp b/src/logger.cpp
index ed09fc5..64a8ac2 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -164,9 +164,11 @@ void dump(const Node *const node)
fprintf(stderr, "\n");
}
-void warn(int loc, std::string message)
+void warn(const int loc,
+ const std::string &message,
+ const std::string &param)
{
- warning_at(loc, 0, message.c_str());
+ warning_at(loc, 0, message.c_str(), param.c_str());
}
} \ No newline at end of file
diff --git a/src/logger.h b/src/logger.h
index c575ef9..815ece5 100644
--- a/src/logger.h
+++ b/src/logger.h
@@ -51,8 +51,9 @@ namespace Log
void dump(const Node *const node);
- void warn(int loc,
- std::string message);
+ void warn(const int loc,
+ const std::string &message,
+ const std::string &param);
}
#endif // LOGGER_H