From d30962c6cf4853390e1f4279fbf326309992777e Mon Sep 17 00:00:00 2001 From: Artalus Date: Mon, 10 Sep 2018 22:40:17 +0300 Subject: [PATCH 1/4] fix clang "macro expansion producing 'defined' has undefined behavior" --- libcef_dll/base/cef_logging.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libcef_dll/base/cef_logging.cc b/libcef_dll/base/cef_logging.cc index a828b8f..d2c601a 100644 --- a/libcef_dll/base/cef_logging.cc +++ b/libcef_dll/base/cef_logging.cc @@ -25,7 +25,11 @@ namespace { #if defined(OS_POSIX) // From base/safe_strerror_posix.cc. -#define USE_HISTORICAL_STRERRO_R (defined(__GLIBC__) || defined(OS_NACL)) +#if defined(__GLIBC__) || defined(OS_NACL) +#define USE_HISTORICAL_STRERRO_R 1 +#else +#define USE_HISTORICAL_STRERRO_R 0 +#endif #if USE_HISTORICAL_STRERRO_R && defined(__GNUC__) // GCC will complain about the unused second wrap function unless we tell it From c08948471ace72a5c8c6ce822d8d91f826fdc9fa Mon Sep 17 00:00:00 2001 From: Artalus Date: Mon, 10 Sep 2018 23:23:54 +0300 Subject: [PATCH 2/4] fix clang "add an explicit instantiation declaration" template warning --- libcef_dll/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcef_dll/CMakeLists.txt b/libcef_dll/CMakeLists.txt index 24dbf17..eed0320 100644 --- a/libcef_dll/CMakeLists.txt +++ b/libcef_dll/CMakeLists.txt @@ -493,3 +493,7 @@ add_library(libcef_dll_wrapper # Remove the default "lib" prefix from the resulting library. set_target_properties(libcef_dll_wrapper PROPERTIES PREFIX "") + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + target_compile_options(libcef_dll_wrapper PRIVATE -Wno-undefined-var-template) +endif() From 8ed2382b78fea418367ebf25de29271f7bb57014 Mon Sep 17 00:00:00 2001 From: Artalus Date: Mon, 10 Sep 2018 23:24:47 +0300 Subject: [PATCH 3/4] fix clang warnings --- brick/event/event_bus.h | 1 - brick/indicator/app_indicator_icon.h | 6 +++--- brick/indicator/gtk2_status_icon.h | 6 +++--- brick/notification_manager_linux.cc | 10 ++++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/brick/event/event_bus.h b/brick/event/event_bus.h index a1b756c..978e4ca 100644 --- a/brick/event/event_bus.h +++ b/brick/event/event_bus.h @@ -53,7 +53,6 @@ class EventBus : public EventObject { EventBus* instance = GetInstance(); // Fetch the list of event pairs unique to this event type - const char * a = typeid(T).name(); Registrations* registrations = instance->handlers[typeid(T)]; // Create a new collection instance for this type if it hasn't been created yet diff --git a/brick/indicator/app_indicator_icon.h b/brick/indicator/app_indicator_icon.h index 83db508..c8ffae8 100644 --- a/brick/indicator/app_indicator_icon.h +++ b/brick/indicator/app_indicator_icon.h @@ -15,9 +15,9 @@ class AppIndicatorIcon : public BaseIcon { public: explicit AppIndicatorIcon(std::string icons_dir); - virtual void SetIcon(IndicatorStatusIcon icon); - virtual void SetTooltip(const char* text); - virtual void Show(); + virtual void SetIcon(IndicatorStatusIcon icon) override; + virtual void SetTooltip(const char* text) override; + virtual void Show() override; void SetMenu(GtkWidget *menu, GtkWidget *activate_item); diff --git a/brick/indicator/gtk2_status_icon.h b/brick/indicator/gtk2_status_icon.h index 351ec8c..e82eb8d 100644 --- a/brick/indicator/gtk2_status_icon.h +++ b/brick/indicator/gtk2_status_icon.h @@ -13,9 +13,9 @@ class Gtk2StatusIcon : public BaseIcon { public: explicit Gtk2StatusIcon(std::string icons_dir); - virtual void SetIcon(IndicatorStatusIcon icon); - virtual void SetTooltip(const char* text); - virtual void Show(); + virtual void SetIcon(IndicatorStatusIcon icon) override; + virtual void SetTooltip(const char* text) override; + virtual void Show() override; GtkStatusIcon* GetHandler(); diff --git a/brick/notification_manager_linux.cc b/brick/notification_manager_linux.cc index 37d45f1..96e2058 100644 --- a/brick/notification_manager_linux.cc +++ b/brick/notification_manager_linux.cc @@ -27,10 +27,12 @@ namespace { const gint kTypeRegular = 0; const gint kTypeMessage = 1; // See https://developer.gnome.org/notification-spec/#signal-notification-closed - const gint kCloseReasonExpire = 1; - const gint kCloseReasonDismissed = 2; - const gint kCloseReasonProgrammaticaly = 3; - const gint kCloseReasonUndefined = 4; + enum CloseReason { + kCloseReasonExpire = 1, + kCloseReasonDismissed = 2, + kCloseReasonProgrammaticaly = 3, + kCloseReasonUndefined = 4, + }; void OnCloseNotification(NotifyNotification *notify, NotificationManager *self) { From 223400f558a6fcd20e2f82f64251b7bcbfeb0184 Mon Sep 17 00:00:00 2001 From: Artalus Date: Tue, 11 Sep 2018 00:23:55 +0300 Subject: [PATCH 4/4] fix gcc "unnecessary parentheses in gtk.h" warnings replace -I with -isystem in pkg-config --cflags output, so that 3rd-party libs won't be affected by -Werror --- macros.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macros.cmake b/macros.cmake index 1c827ef..7b41137 100644 --- a/macros.cmake +++ b/macros.cmake @@ -150,6 +150,8 @@ macro(FIND_LINUX_LIBRARIES libraries) message(FATAL_ERROR "Failed to find one of these libraries: ${libraries}") endif() + STRING(REGEX REPLACE "(^| )-I" " -isystem " FLL_CFLAGS "${FLL_CFLAGS}") + # Strip leading and trailing whitepspace. STRING(STRIP "${FLL_CFLAGS}" FLL_CFLAGS) STRING(STRIP "${FLL_LDFLAGS}" FLL_LDFLAGS)