mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-18 17:32:09 +08:00
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.
This commit is contained in:

committed by
Xiang Xiao

parent
a6c41fbaeb
commit
b5fb80c0cd
@@ -28,8 +28,21 @@ RTPTOOLS_SRCDIR = $(RTPTOOLS_UNPACK)
|
|||||||
DEPPATH += --dep-path $(RTPTOOLS_SRCDIR)
|
DEPPATH += --dep-path $(RTPTOOLS_SRCDIR)
|
||||||
VPATH += :$(RTPTOOLS_SRCDIR)
|
VPATH += :$(RTPTOOLS_SRCDIR)
|
||||||
|
|
||||||
CFLAGS += -Wno-maybe-uninitialized -Wno-strict-prototypes
|
CFLAGS += -Wno-strict-prototypes -Wno-unused-function -Wno-format -Wno-shadow
|
||||||
CFLAGS += -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 += multimer.c
|
||||||
CSRCS += notify.c
|
CSRCS += notify.c
|
||||||
|
Reference in New Issue
Block a user