diff --git a/extras/Build/CMake/JUCEHelperTargets.cmake b/extras/Build/CMake/JUCEHelperTargets.cmake index 2cbeb2efa5..c82dd9bec8 100644 --- a/extras/Build/CMake/JUCEHelperTargets.cmake +++ b/extras/Build/CMake/JUCEHelperTargets.cmake @@ -13,7 +13,7 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQU -Wzero-as-null-pointer-constant -Wcast-align -Winconsistent-missing-destructor-override -Wshift-sign-overflow -Wnullable-to-nonnull-conversion -Wno-missing-field-initializers - -Wno-ignored-qualifiers -Wswitch-enum) + -Wno-ignored-qualifiers -Wswitch-enum -Wpedantic) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(juce_recommended_warning_flags INTERFACE -Wall -Wextra -Wstrict-aliasing -Wuninitialized -Wunused-parameter @@ -21,7 +21,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") -Wunreachable-code -Wzero-as-null-pointer-constant -Wcast-align -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-ignored-qualifiers -Wswitch-enum - -Wredundant-decls) + -Wredundant-decls -Wpedantic) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0.0") target_compile_options(juce_recommended_warning_flags INTERFACE "-Wno-strict-overflow") diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index c1081898ba..dc170b2722 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -35,7 +35,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", "-Wshift-sign-overflow", "-Wpragma-pack", "-Wzero-as-null-pointer-constant", - "-Winconsistent-missing-destructor-override") + "-Winconsistent-missing-destructor-override", + "-Wfour-char-constants") #include @@ -72,6 +73,8 @@ static_assert (AAX_SDK_CURRENT_REVISION >= AAX_SDK_2p3p0_REVISION, "JUCE require JUCE_END_IGNORE_WARNINGS_MSVC JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wfour-char-constants") + #if JUCE_WINDOWS #ifndef JucePlugin_AAXLibs_path #error "You need to define the JucePlugin_AAXLibs_path macro. (This is best done via the Projucer)" @@ -2344,6 +2347,8 @@ AAX_Result JUCE_CDECL GetEffectDescriptions (AAX_ICollection* collection) return AAX_ERROR_NULL_OBJECT; } +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + //============================================================================== #if _MSC_VER || JUCE_MINGW extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID) { if (reason == DLL_PROCESS_ATTACH) Process::setCurrentModuleInstanceHandle (instance); return true; } diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 9b9d691aa9..8ec0b60239 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -36,7 +36,9 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wshorten-64-to-32", "-Wshadow", "-Wswitch-enum", "-Wzero-as-null-pointer-constant", - "-Wnullable-to-nonnull-conversion") + "-Wnullable-to-nonnull-conversion", + "-Wgnu-zero-variadic-macro-arguments", + "-Wformat-pedantic") #include "../utility/juce_IncludeSystemHeaders.h" diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm index da9e372932..6f1e7ff053 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm @@ -34,7 +34,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wparentheses", "-Wswitch-enum", "-Wzero-as-null-pointer-constant", "-Wnullable-to-nonnull-conversion", - "-Wignored-qualifiers") + "-Wignored-qualifiers", + "-Wfour-char-constants") // From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole // set of functions with rather generic names. However, we still need a couple diff --git a/modules/juce_core/system/juce_CompilerWarnings.h b/modules/juce_core/system/juce_CompilerWarnings.h index c5dfb12c18..07cc1c56e9 100644 --- a/modules/juce_core/system/juce_CompilerWarnings.h +++ b/modules/juce_core/system/juce_CompilerWarnings.h @@ -77,7 +77,7 @@ /** Apply the macro FN to each of the other arguments. */ #define JUCE_EACH(FN, ...) \ - JUCE_NTH_ARG_(, ##__VA_ARGS__, \ + JUCE_NTH_ARG_(, __VA_ARGS__, \ JUCE_EACH_39_, \ JUCE_EACH_38_, \ JUCE_EACH_37_, \ @@ -118,7 +118,7 @@ JUCE_EACH_02_, \ JUCE_EACH_01_, \ JUCE_EACH_00_) \ - (FN, ##__VA_ARGS__) + (FN, __VA_ARGS__) /** Concatenate two tokens to form a new token. */ #define JUCE_CONCAT_(a, b) a##b @@ -148,7 +148,7 @@ #define JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, ...) \ _Pragma(JUCE_TO_STRING(compiler diagnostic push)) \ - JUCE_EACH(JUCE_CONCAT(JUCE_IGNORE_, compiler), ##__VA_ARGS__) + JUCE_EACH(JUCE_CONCAT(JUCE_IGNORE_, compiler), __VA_ARGS__) /** Push a new warning scope, and then ignore each warning for either clang or gcc. If the compiler doesn't support __has_warning, we add -Wpragmas @@ -157,10 +157,10 @@ */ #if defined (__has_warning) #define JUCE_PUSH_WARNINGS_GCC_LIKE(compiler, ...) \ - JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, ##__VA_ARGS__) + JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, __VA_ARGS__) #else #define JUCE_PUSH_WARNINGS_GCC_LIKE(compiler, ...) \ - JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, "-Wpragmas", ##__VA_ARGS__) + JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, "-Wpragmas", __VA_ARGS__) #endif /** Pop the current warning scope. */