From 70193c92b2cc135ff83602f1ffdf0490c6146c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 5 Mar 2013 12:53:37 +0100 Subject: [PATCH] Remove spurious display when there is zero preprocessor warning --- ModFile.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ModFile.cc b/ModFile.cc index 47371866..1fbe8a38 100644 --- a/ModFile.cc +++ b/ModFile.cc @@ -640,8 +640,10 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool no_log, b if (!no_warn) { - mOutputFile << "disp('Note: " << warnings.countWarnings() << " warning(s) encountered in the preprocessor')" << endl - << "if ~isempty(lastwarn)" << endl + if (warnings.countWarnings() > 0) + mOutputFile << "disp('Note: " << warnings.countWarnings() << " warning(s) encountered in the preprocessor')" << endl; + + mOutputFile << "if ~isempty(lastwarn)" << endl << " disp('Note: warning(s) encountered in MATLAB/Octave code')" << endl << "end" << endl; }