Skip to content

Commit

Permalink
Enable warnings for Clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadden committed Jul 13, 2018
1 parent 95e296f commit a5c82c6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ elseif(FIPS_MSVC)
# Also suppress linker warnings about missing .pdb files that seem to inevitably creep in.
add_link_options(/ignore:4099)
elseif(FIPS_CLANG)
add_compile_options()
add_compile_options(-Wall -Werror)
add_compile_options(-Wno-logical-op-parentheses)
endif()

# Enable "big objects" for Visual C++ and try to speed up builds.
Expand Down
3 changes: 3 additions & 0 deletions src/alia/signals/adaptors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ struct readability_faker : signal<
typename Wrapped::value_type const&
read() const
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnull-dereference"
return *(typename Wrapped::value_type const*) nullptr;
#pragma clang diagnostic pop
}
// LCOV_EXCL_STOP
bool
Expand Down
5 changes: 4 additions & 1 deletion src/alia/signals/basic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ struct empty_signal : signal<Value, bidirectional_signal>
Value const&
read() const
{
return *(Value*) nullptr;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnull-dereference"
return *(Value const*) nullptr;
#pragma clang diagnostic pop
}
// LCOV_EXCL_STOP
bool
Expand Down
3 changes: 3 additions & 0 deletions src/alia/signals/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ struct signal<Value, write_only_signal> : signal_interface<Value>
Value const&
read() const
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnull-dereference"
return *(Value const*) nullptr;
#pragma clang diagnostic pop
}
// LCOV_EXCL_STOP
};
Expand Down

0 comments on commit a5c82c6

Please sign in to comment.