[Pdbg] [PATCH] Makefile.am: Disable -Wunused-const-variable for generated file

Joel Stanley joel at jms.id.au
Thu Apr 21 15:45:09 AEST 2022


The shipped gdb parser will fail to build due to this warning and
Werror:

src/gdb_parser_precompile.c:249:18: error: ‘gdb_en_main’ defined but not
used [-Werror=unused-const-variable=]
  249 | static const int gdb_en_main = 97;
      |                  ^~~~~~~~~~~
src/gdb_parser_precompile.c:246:18: error: ‘gdb_first_final’ defined but
not used [-Werror=unused-const-variable=]
  246 | static const int gdb_first_final = 97;
      |                  ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Disable that specific warning like we do for the generated version.

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile.am b/Makefile.am
index 4f7cdbdfb815..616030e37a8f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,6 +116,7 @@ endif
 libpdbg/dtb.c: $(DT_headers)
 
 src/pdbg-gdb_parser.$(OBJEXT): CFLAGS+=-Wno-unused-const-variable
+src/pdbg-gdb_parser_precompile.$(OBJEXT): CFLAGS+=-Wno-unused-const-variable
 
 pdbg_LDADD = libpdbg.la libccan.a \
 	-L.libs -lrt
-- 
2.35.1



More information about the Pdbg mailing list