[Replicant] [libsamsung-ipc] [PATCH 07/26] scripts: guix.scm: add -Werror=pedantic to detect Replicant 6.0 warnings

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Mon Mar 28 20:20:21 UTC 2022


Without the commit 355433ab5f17f25ca202ec092d989b267fd78c19
(tools: nv_data_imei: get rid of missing initializer warning),
we have the following warnings when building Replicant 6.0:
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:245:2:
    warning: missing initializer for field 'option' of 'struct
    command_option' [-Wmissing-field-initializers]
      { /* Sentinel */ },
      ^
    In file included from
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:39:0:
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.h:65:10:
    note: 'option' declared here
    uint8_t option;
            ^
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:277:2:
    warning: missing initializer for field 'name' of 'struct command'
    [-Wmissing-field-initializers]
    { /* Sentinel */ },
      ^
    In file included from
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:39:0:
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.h:57:14:
    note: 'name' declared here
    const char *name;
                ^

The addition of -Werror=pedantic in guix.scm enables to detect these
as the build would then fail:
      CC       nv_data-imei.o
    nv_data-imei.c:245:2: error:
    ISO C forbids empty initializer braces [-Werror=pedantic]
      245 |  { /* Sentinel */ },
          |  ^
    nv_data-imei.c:277:2: error:
    ISO C forbids empty initializer braces [-Werror=pedantic]
      277 |  { /* Sentinel */ },
          |  ^
      CC       nv_data-md5.o

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 scripts/guix.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/guix.scm b/scripts/guix.scm
index a917a82..10d0b74 100644
--- a/scripts/guix.scm
+++ b/scripts/guix.scm
@@ -72,6 +72,7 @@
    " -Werror=sequence-point"
    " -Winit-self"
    " -Wno-unused"
+   " -Wpedantic"
    " -Wpointer-arith"
    " -Wunused"
    " -Wunused-function"))
-- 
2.35.1



More information about the Replicant mailing list