add old warnings.pri file (copied from appbase project)

This commit is contained in:
Rasmus Karlsson 2019-08-10 23:19:00 +02:00
parent 149960a986
commit 381aaaa2d8
2 changed files with 43 additions and 0 deletions

View file

@ -42,6 +42,7 @@ macx {
# Submodules
DEFINES += IRC_NAMESPACE=Communi
include(lib/warnings.pri)
include(lib/appbase.pri)
include(lib/fmt.pri)
include(lib/humanize.pri)

42
lib/warnings.pri Normal file
View file

@ -0,0 +1,42 @@
# Define warning flags for Chatterino
win32-msvc* {
QMAKE_CXXFLAGS_WARN_ON = /W4
# 4714 - function marked as __forceinline not inlined
# 4996 - occurs when the compiler encounters a function or variable that is marked as deprecated.
# These functions may have a different preferred name, may be insecure or have
# a more secure variant, or may be obsolete.
# 4505 - unreferenced local version has been removed
# 4127 - conditional expression is constant
# 4503 - decorated name length exceeded, name was truncated
# 4100 - unreferences formal parameter
# 4305 - possible truncation of data
# 4267 - possible loss of data in return
QMAKE_CXXFLAGS_WARN_ON += /wd4714
QMAKE_CXXFLAGS_WARN_ON += /wd4996
QMAKE_CXXFLAGS_WARN_ON += /wd4505
QMAKE_CXXFLAGS_WARN_ON += /wd4127
QMAKE_CXXFLAGS_WARN_ON += /wd4503
QMAKE_CXXFLAGS_WARN_ON += /wd4100
QMAKE_CXXFLAGS_WARN_ON += /wd4305
QMAKE_CXXFLAGS_WARN_ON += /wd4267
} else {
QMAKE_CXXFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function
QMAKE_CXXFLAGS_WARN_ON += -Wno-switch
QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-declarations
QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable
# Disabling strict-aliasing warnings for now, although we probably want to re-enable this in the future
QMAKE_CXXFLAGS_WARN_ON += -Wno-strict-aliasing
QMAKE_CXXFLAGS_WARN_ON += -Werror=return-type
equals(QMAKE_CXX, "clang++") {
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedef
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-private-field
} else {
QMAKE_CXXFLAGS_WARN_ON += -Wno-class-memaccess
}
}