Skip to content
Snippets Groups Projects
Unverified Commit 6c89c7cd authored by Benjamin Cumming's avatar Benjamin Cumming Committed by GitHub
Browse files

repair compiler warnings with AppleClang (#592)

Turns out that CMake thinks Clang and AppleClang are different things.
parent 1ffccf2d
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ std::fstream open_or_throw(const path& p, std::ios_base::openmode mode, bool exc ...@@ -18,7 +18,7 @@ std::fstream open_or_throw(const path& p, std::ios_base::openmode mode, bool exc
throw std::runtime_error(strsub("unable to open file %", p)); throw std::runtime_error(strsub("unable to open file %", p));
} }
return std::move(file); return file;
} }
} // namespace aux } // namespace aux
......
...@@ -13,13 +13,14 @@ endif() ...@@ -13,13 +13,14 @@ endif()
set(CXXOPT_WALL set(CXXOPT_WALL
-Wall -Wall
# XL C: # Clang:
# #
# * Disable 'missing-braces' warning: this will inappropriately # * Disable 'missing-braces' warning: this will inappropriately
# flag initializations such as # flag initializations such as
# std::array<int,3> a={1,2,3}; # std::array<int,3> a={1,2,3};
$<IF:$<CXX_COMPILER_ID:XL>,-Wno-missing-braces,> $<IF:$<CXX_COMPILER_ID:Clang>,-Wno-missing-braces,>
$<IF:$<CXX_COMPILER_ID:AppleClang>,-Wno-missing-braces,>
# Clang: # Clang:
# #
...@@ -28,6 +29,7 @@ set(CXXOPT_WALL ...@@ -28,6 +29,7 @@ set(CXXOPT_WALL
# effects. # effects.
$<IF:$<CXX_COMPILER_ID:Clang>,-Wno-potentially-evaluated-expression,> $<IF:$<CXX_COMPILER_ID:Clang>,-Wno-potentially-evaluated-expression,>
$<IF:$<CXX_COMPILER_ID:AppleClang>,-Wno-potentially-evaluated-expression,>
# * Clang erroneously warns that T is an 'unused type alias' # * Clang erroneously warns that T is an 'unused type alias'
# in code like this: # in code like this:
...@@ -37,10 +39,12 @@ set(CXXOPT_WALL ...@@ -37,10 +39,12 @@ set(CXXOPT_WALL
# }; # };
$<IF:$<CXX_COMPILER_ID:Clang>,-Wno-unused-local-typedef,> $<IF:$<CXX_COMPILER_ID:Clang>,-Wno-unused-local-typedef,>
$<IF:$<CXX_COMPILER_ID:AppleClang>,-Wno-unused-local-typedef,>
# * Ignore warning if string passed to snprintf is not a string literal. # * Ignore warning if string passed to snprintf is not a string literal.
$<IF:$<CXX_COMPILER_ID:Clang>,-Wno-format-security,> $<IF:$<CXX_COMPILER_ID:Clang>,-Wno-format-security,>
$<IF:$<CXX_COMPILER_ID:AppleClang>,-Wno-format-security,>
# GCC: # GCC:
# #
......
...@@ -63,7 +63,7 @@ class brunel_recipe: public recipe { ...@@ -63,7 +63,7 @@ class brunel_recipe: public recipe {
public: public:
brunel_recipe(cell_size_type nexc, cell_size_type ninh, cell_size_type next, double in_degree_prop, brunel_recipe(cell_size_type nexc, cell_size_type ninh, cell_size_type next, double in_degree_prop,
float weight, float delay, float rel_inh_strength, double poiss_lambda, int seed = 42): float weight, float delay, float rel_inh_strength, double poiss_lambda, int seed = 42):
ncells_exc_(nexc), ncells_inh_(ninh), ncells_ext_(next), delay_(delay), seed_(seed) { ncells_exc_(nexc), ncells_inh_(ninh), delay_(delay), seed_(seed) {
// Make sure that in_degree_prop in the interval (0, 1] // Make sure that in_degree_prop in the interval (0, 1]
if (in_degree_prop <= 0.0 || in_degree_prop > 1.0) { if (in_degree_prop <= 0.0 || in_degree_prop > 1.0) {
std::out_of_range("The proportion of incoming connections should be in the interval (0, 1]."); std::out_of_range("The proportion of incoming connections should be in the interval (0, 1].");
...@@ -156,9 +156,6 @@ private: ...@@ -156,9 +156,6 @@ private:
// Number of inhibitory cells. // Number of inhibitory cells.
cell_size_type ncells_inh_; cell_size_type ncells_inh_;
// Number of Poisson connections each neuron receives
cell_size_type ncells_ext_;
// Weight of excitatory synapses. // Weight of excitatory synapses.
float weight_exc_; float weight_exc_;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment