This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new b5fb80c0c apps/netutils/rtptools: fix warning while building with clang
b5fb80c0c is described below
commit b5fb80c0cdf33a11f4d5638d26a2d99bbc649da5
Author: Tiago Medicci Serrano <[email protected]>
AuthorDate: Tue May 2 09:57:39 2023 -0300
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