cmake: set warning and error options

The set is far from perfect, but guards against common errors with GCC.
This commit is contained in:
Eugene Shalygin
2017-04-27 14:35:28 +02:00
parent 98415917c6
commit c4e16aa820
9 changed files with 147 additions and 7 deletions

View File

@@ -2,6 +2,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD "11")
add_definitions(-DBOOST_NO_CXX11_RVALUE_REFERENCES)
include(MacroQbtCompilerSettings)
qbt_set_compiler_options()
include(MacroLinkQtComponents)
include(QbtTargetSources)

View File

@@ -96,7 +96,7 @@ private:
// Search data
mutable QHash<quint32, QString> m_countries;
quint32 m_size;
const uchar *m_data;
uchar *m_data;
};
#endif // GEOIPDATABASE_H

View File

@@ -121,7 +121,7 @@ Http::Response AbstractWebApplication::processRequest(const Http::Request &reque
print(QObject::tr("Your IP address has been banned after too many failed authentication attempts."), Http::CONTENT_TYPE_TXT);
}
else {
processRequest();
doProcessRequest();
}
return response();

View File

@@ -54,10 +54,10 @@ public:
explicit AbstractWebApplication(QObject *parent = 0);
virtual ~AbstractWebApplication();
Http::Response processRequest(const Http::Request &request, const Http::Environment &env);
Http::Response processRequest(const Http::Request &request, const Http::Environment &env) final;
protected:
virtual void processRequest() = 0;
virtual void doProcessRequest() = 0;
bool isBanned() const;
int failedAttempts() const;

View File

@@ -814,7 +814,7 @@ bool WebApplication::isPublicScope()
return (scope_ == DEFAULT_SCOPE || scope_ == VERSION_INFO);
}
void WebApplication::processRequest()
void WebApplication::doProcessRequest()
{
scope_ = DEFAULT_SCOPE;
action_ = DEFAULT_ACTION;

View File

@@ -103,7 +103,7 @@ private:
QString action_;
QStringList args_;
void processRequest();
void doProcessRequest() override;
bool isPublicScope();
void parsePath();