From c466796b93b4b99c0bf0a0d00822e5890925fe37 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 13 Oct 2013 20:14:26 +0200 Subject: [PATCH 1/2] Display -mcpu/-mattr help even with no source files given. Unfortunately, we can't easily add a test for this in our current test runner setup (i.e. dmd-testsuite). GitHub: Fixes #505. --- driver/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver/main.cpp b/driver/main.cpp index f349cc4a..37b66122 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -202,6 +202,9 @@ static void parseCommandLine(int argc, char **argv, Strings &sourceFiles, bool & #endif ); + helpOnly = mCPU == "help" || + (std::find(mAttrs.begin(), mAttrs.end(), "help") != mAttrs.end()); + // Print config file path if -v was passed if (global.params.verbose) { const std::string& path = cfg_file.path(); From 54aa182f7228da7b8ac171821d436fb71943e1dc Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 13 Oct 2013 20:15:18 +0200 Subject: [PATCH 2/2] Remove Walter-ism that doesn't even work in release mode. --- driver/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driver/main.cpp b/driver/main.cpp index 37b66122..52d2a241 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -1074,8 +1074,7 @@ int main(int argc, char **argv) if (name && name[0] == '-' && name[1] == 0) { // Write to stdout; assume it succeeds - int n = fwrite(buf.data, 1, buf.offset, stdout); - assert(n == buf.offset); // keep gcc happy about return values + (void)fwrite(buf.data, 1, buf.offset, stdout); } else {