[gnome-terminal] build: Use default CXX flags and fix some compiler warnings



commit af6fa5af6ba69e3cd392de20e9c2954c6405a2dc
Author: Christian Persch <chpe src gnome org>
Date:   Thu Oct 21 18:13:31 2021 +0200

    build: Use default CXX flags and fix some compiler warnings

 meson.build              | 4 ++--
 src/terminal-nautilus.cc | 3 +--
 src/terminal-window.cc   | 4 +++-
 3 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/meson.build b/meson.build
index 67f97d02..64da913d 100644
--- a/meson.build
+++ b/meson.build
@@ -181,10 +181,8 @@ compiler_flags_common = [
   '-Wall',
   '-Wcast-align',
   '-Wendif-labels',
-  '-Werror=implicit-function-declaration',
   '-Werror=init-self',
   '-Werror=missing-include-dirs',
-  '-Werror=missing-prototypes',
   '-Werror=pointer-arith',
   '-Wextra',
   '-Wfloat-equal',
@@ -196,6 +194,7 @@ compiler_flags_common = [
   '-Wmissing-include-dirs',
   '-Wmissing-noreturn',
   '-Wnested-externs',
+  '-Wno-maybe-uninitialized',
   '-Wno-missing-field-initializers',
   '-Wno-switch-enum',
   '-Wno-unused-parameter',
@@ -290,6 +289,7 @@ endforeach
 # ... and now make these flags the default
 
 add_project_arguments(global_cflags, language: 'c',)
+add_project_arguments(global_cxxflags, language: 'cpp')
 
 # Dependencies
 
diff --git a/src/terminal-nautilus.cc b/src/terminal-nautilus.cc
index 0588d0f3..b29de5c5 100644
--- a/src/terminal-nautilus.cc
+++ b/src/terminal-nautilus.cc
@@ -439,8 +439,7 @@ terminal_nautilus_menu_item_activate (NautilusMenuItem *item)
       if (menu_item->remote_terminal)
         break;
 
-      /* fall through */
-
+      [[fallthrough]];
     case FILE_INFO_OTHER: {
       GFile *file;
 
diff --git a/src/terminal-window.cc b/src/terminal-window.cc
index 08504b9a..60f49500 100644
--- a/src/terminal-window.cc
+++ b/src/terminal-window.cc
@@ -1976,7 +1976,9 @@ terminal_window_state_event (GtkWidget            *widget,
 
   _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY,
                          "Window state changed mask %x old state %x new state %x\n",
-                         event->changed_mask, priv->window_state, event->new_window_state);
+                         unsigned(event->changed_mask),
+                         unsigned(priv->window_state),
+                         unsigned(event->new_window_state));
 
   if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]