From: Zbigniew Jędrzejewski-Szmek Date: Sat, 22 Apr 2017 22:49:49 +0000 (-0400) Subject: journal/fsprg: set -Wno-pointer-arithm only for that file X-Git-Tag: v234~286^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=521e7c3aea7cfc478380acb9857beb938855f00f;p=platform%2Fupstream%2Fsystemd.git journal/fsprg: set -Wno-pointer-arithm only for that file Both gcc and clang issue a host of warnings about void pointers used in arithmetic. The warning must be ignored in that file to avoid multiple warnings. Makefile.am used to set this for all libsystemd-journal-internal.a sources, because there's no finer granularity for warnings. Let's just set it for this one file. --- diff --git a/Makefile.am b/Makefile.am index 4ba2305..e362060 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4556,10 +4556,8 @@ libsystemd_journal_internal_la_SOURCES += \ libsystemd_journal_internal_la_LIBADD += \ $(GCRYPT_LIBS) -# fsprg.c is a drop-in file using void pointer arithmetic libsystemd_journal_internal_la_CFLAGS += \ - $(GCRYPT_CFLAGS) \ - -Wno-pointer-arith + $(GCRYPT_CFLAGS) endif noinst_LTLIBRARIES += \ diff --git a/src/journal/fsprg.c b/src/journal/fsprg.c index 612b10f..e7c2288 100644 --- a/src/journal/fsprg.c +++ b/src/journal/fsprg.c @@ -40,6 +40,9 @@ #define RND_GEN_Q 0x02 #define RND_GEN_X 0x03 +#pragma GCC diagnostic ignored "-Wpointer-arith" +/* TODO: remove void* arithmetic and this work-around */ + /******************************************************************************/ static void mpi_export(void *buf, size_t buflen, const gcry_mpi_t x) {