diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-01-02 20:08:48 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-01-02 20:10:53 +0100 |
commit | fb18bd235bc716963c72c1dd6358176cb50516ae (patch) | |
tree | cda9e38546c0d2a738dd9e2adc7f984d431e6beb /backend | |
parent | 8ac9ddf460cc4c1b2972df1069128fb615b31042 (diff) |
Add missing return statement causing segfault
Added compile flags to give error when missing return statement
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ninja/Ninja.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 4eecd6d..3a46af5 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -64,6 +64,9 @@ namespace backend case PackageType::DYNAMIC: case PackageType::LIBRARY: return Ninja::LibraryType::DYNAMIC; + default: + assert(false); + return (Ninja::LibraryType)-1; } } @@ -163,6 +166,7 @@ namespace backend { case Compiler::GCC: return ".o"; case Compiler::MSVC: return ".obj"; + default: return nullptr; } } @@ -620,7 +624,8 @@ namespace backend { case Compiler::GCC: { - result += " '-I" + config.getPackageName() + "@exe' '-I..' '-fdiagnostics-color=always' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Wall' '-Winvalid-pch' '-Wnon-virtual-dtor' " + optimizationFlags + " '-g'"; + // -Werror + result += " '-I" + config.getPackageName() + "@exe' '-I..' -Wall -Wextra -Werror=return-type -fexceptions -fdiagnostics-show-option '-fdiagnostics-color=always' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Winvalid-pch' '-Wnon-virtual-dtor' " + optimizationFlags + " '-g'"; break; } case Compiler::MSVC: |