Skip to content

Commit

Permalink
Added additional warning levels and cleaned up warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Aug 6, 2019
1 parent c908d01 commit af5287b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ else()
set(SOCKPP_LIB ${SOCKPP_STATIC})
endif()


# --- Examples Applications ---

if(SOCKPP_BUILD_EXAMPLES)
Expand Down
4 changes: 2 additions & 2 deletions include/sockpp/acceptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class acceptor_tmpl : public acceptor
* @param addr The address to which we get bound.
* @return @em true on success, @em false on error
*/
bool bind(const addr_t& addr) { base::bind(addr); }
bool bind(const addr_t& addr) { return base::bind(addr); }
/**
* Opens the acceptor socket, binds it to the specified address, and starts
* listening.
Expand Down Expand Up @@ -217,7 +217,7 @@ class acceptor_tmpl : public acceptor

/////////////////////////////////////////////////////////////////////////////
// end namespace sockpp
};
}

#endif // __sockpp_acceptor_h

2 changes: 1 addition & 1 deletion include/sockpp/connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class connector_tmpl : public connector

/////////////////////////////////////////////////////////////////////////////
// end namespace sockpp
};
}

#endif // __sockpp_connector_h

2 changes: 1 addition & 1 deletion include/sockpp/inet6_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ std::ostream& operator<<(std::ostream& os, const inet6_address& addr);

/////////////////////////////////////////////////////////////////////////////
// end namespace sockpp
};
}

#endif // __sockpp_inet6_addr_h

2 changes: 1 addition & 1 deletion include/sockpp/inet_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ std::ostream& operator<<(std::ostream& os, const inet_address& addr);

/////////////////////////////////////////////////////////////////////////////
// end namespace sockpp
};
}

#endif // __sockpp_inet_addr_h

3 changes: 2 additions & 1 deletion include/sockpp/unix_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ std::ostream& operator<<(std::ostream& os, const unix_address& addr);

/////////////////////////////////////////////////////////////////////////////
// end namespace sockpp
};
}

#endif // __sockpp_unix_addr_h

10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ endif()
# This is only necessary for older compilers, but doesn't hurt
set_target_properties(sockpp-objs PROPERTIES POSITION_INDEPENDENT_CODE 1)


# --- Warnings ---

if(MSVC)
target_compile_options(sockpp-objs PRIVATE /W4 /WX)
else()
target_compile_options(sockpp-objs PRIVATE -Wall -Wextra -pedantic) # -Werror)
endif()


0 comments on commit af5287b

Please sign in to comment.