Skip to content

Commit 28098fa

Browse files
committed
mitigated C4834 Visual Studio and -Wunused-result Clang warnings
``` warning C4834: discarding return value of function with [[nodiscard]] attribute ``` ``` error: ignoring return value of function declared with 'nodiscard' attribute [clang-diagnostic-unused-result] ```
1 parent 4a9fced commit 28098fa

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

gui/checkthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void CheckThread::runAddonsAndTools(const Settings& settings, const FileSettings
264264
}
265265
f1.close();
266266
}
267-
f1.open(QIODevice::WriteOnly | QIODevice::Text);
267+
(void)f1.open(QIODevice::WriteOnly | QIODevice::Text); // TODO: check result
268268
QTextStream out1(&f1);
269269
out1 << chksum;
270270

gui/fileviewdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void FileViewDialog::loadTextFile(const QString &filename, QTextEdit *edit)
6262
return;
6363
}
6464

65-
file.open(QIODevice::ReadOnly | QIODevice::Text);
65+
(void)file.open(QIODevice::ReadOnly | QIODevice::Text); // TODO: check result
6666
if (!file.isReadable()) {
6767
QString msg(tr("Could not read the file: %1"));
6868
msg = msg.arg(filename);

gui/mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ void MainWindow::complianceReport()
17171717
}
17181718

17191719
QTemporaryFile tempResults;
1720-
tempResults.open();
1720+
(void)tempResults.open(); // TODO: check result
17211721
tempResults.close();
17221722

17231723
mUI->mResults->save(tempResults.fileName(), Report::XMLV2, mCppcheckCfgProductName);

tools/triage/mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void MainWindow::loadFile()
112112
if (fileName.isEmpty())
113113
return;
114114
QFile file(fileName);
115-
file.open(QIODevice::ReadOnly | QIODevice::Text);
115+
(void)file.open(QIODevice::ReadOnly | QIODevice::Text); // TODO: check result
116116
QTextStream textStream(&file);
117117
load(textStream);
118118
}

0 commit comments

Comments
 (0)