From b5fb80c0cdf33a11f4d5638d26a2d99bbc649da5 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Serrano Date: Tue, 2 May 2023 09:57:39 -0300 Subject: [PATCH] apps/netutils/rtptools: fix warning while building with clang The flag '-Wno-maybe-uninitialized' is not known by clang, so a workaround substitutes it for '-Wno-uninitialized' when clang is being used as C compiler. --- netutils/rtptools/Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/netutils/rtptools/Makefile b/netutils/rtptools/Makefile index 4f3b36bc5..b6b3a9704 100644 --- a/netutils/rtptools/Makefile +++ b/netutils/rtptools/Makefile @@ -28,8 +28,21 @@ RTPTOOLS_SRCDIR = $(RTPTOOLS_UNPACK) DEPPATH += --dep-path $(RTPTOOLS_SRCDIR) VPATH += :$(RTPTOOLS_SRCDIR) -CFLAGS += -Wno-maybe-uninitialized -Wno-strict-prototypes -CFLAGS += -Wno-unused-function -Wno-format -Wno-shadow +CFLAGS += -Wno-strict-prototypes -Wno-unused-function -Wno-format -Wno-shadow + +# Workaround for clang. +# +# error: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Werror,-Wunknown-warning-option] +# make[3]: *** [multimer.c.Users.runner.work.nuttx.nuttx.sources.apps.netutils.rtptools.o] Error 1 +# +# It's possible to use only '-Wno-uninitialized' instead, however, it isn't +# recommended as it could mask erroneous code. +# +ifneq ($(shell $(CC) --version | grep clang),) +CFLAGS += -Wno-uninitialized +else +CFLAGS += -Wno-maybe-uninitialized +endif CSRCS += multimer.c CSRCS += notify.c