From c3392a9fccc04129816057b1184c651171034376 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 22:15:01 +0200 Subject: some CXXFLAGS housekeeping More warnings are always better. Git-Dch: Ignore --- apt-pkg/aptconfiguration.h | 2 +- apt-pkg/contrib/sptr.h | 8 ++++++++ apt-pkg/edsp.h | 2 +- buildlib/environment.mak.in | 6 +++++- test/libapt/makefile | 3 ++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index 353843c3e..fbd9b02e6 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -122,7 +122,7 @@ namespace Configuration { /*{{{*/ /** \return Return a comma-separated list of enabled build profile specifications */ std::string const getBuildProfilesString(); /*}}}*/ -}; +} /*}}}*/ } #endif diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h index 9df0e44a7..e2e811b1d 100644 --- a/apt-pkg/contrib/sptr.h +++ b/apt-pkg/contrib/sptr.h @@ -60,7 +60,15 @@ class SPtrArray inline SPtrArray(T *Ptr) : Ptr(Ptr) {}; inline SPtrArray() : Ptr(0) {}; +#if __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" + // gcc warns about this, but we can do nothing hereā€¦ +#endif inline ~SPtrArray() {delete [] Ptr;}; +#if __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif }; #endif diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 72b886a31..4f5f500a1 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -211,6 +211,6 @@ namespace EDSP /*{{{*/ bool ResolveExternal(const char* const solver, pkgDepCache &Cache, bool const upgrade, bool const distUpgrade, bool const autoRemove, OpProgress *Progress = NULL); -}; +} /*}}}*/ #endif diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index b0a8d9d35..0dff02e69 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -11,7 +11,11 @@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2 CXX = @CXX@ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations -CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn +CXXFLAGS+= -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef +# suggests methods which already have such an attribute +#CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn +# gcc reports currently lots of them at the end of file - unknown reason +CXXFLAGS+= -Wno-deprecated-declarations # a bit too pedantic to be run by default #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros NUM_PROCS = @NUM_PROCS@ diff --git a/test/libapt/makefile b/test/libapt/makefile index 61a8aaf31..c078cc568 100644 --- a/test/libapt/makefile +++ b/test/libapt/makefile @@ -33,7 +33,7 @@ GTEST_DIR = /usr/src/gtest # Flags passed to the preprocessor. # Set Google Test's header directory as a system directory, such that # the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -isystem $(GTEST_DIR)/include +#CPPFLAGS += -isystem $(GTEST_DIR)/include # Flags passed to the C++ compiler. CXXFLAGS += -pthread @@ -41,6 +41,7 @@ CXXFLAGS += -pthread CXXFLAGS+= -Wno-missing-declarations CXXFLAGS+= -Wno-missing-field-initializers CXXFLAGS+= -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wno-suggest-attribute=noreturn +CXXFLAGS+= -Wno-undef # All Google Test headers. Usually you shouldn't change this definition. GTEST_HEADERS = /usr/include/gtest/*.h \ -- cgit v1.2.3