Merge pull request #9703 from miri64/pkg/fix/format-str-literal

pkg: deal with format string non-literals
This commit is contained in:
Cenk Gündoğan 2018-08-06 10:23:59 +02:00 committed by GitHub
commit e19f6463c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -12,3 +12,7 @@ all: git-download
"$(MAKE)" -C $(PKG_BUILDDIR) "$(MAKE)" -C $(PKG_BUILDDIR)
include $(RIOTBASE)/pkg/pkg.mk include $(RIOTBASE)/pkg/pkg.mk
ifeq (llvm,$(TOOLCHAIN))
CFLAGS += -Wno-format-nonliteral
endif

View File

@ -28,6 +28,7 @@
/* adapted from OpenThread posix example: /* adapted from OpenThread posix example:
* See: https://github.com/openthread/openthread/blob/master/examples/platforms/posix/logging.c */ * See: https://github.com/openthread/openthread/blob/master/examples/platforms/posix/logging.c */
__attribute__((__format__ (__printf__, 3, 4)))
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
{ {
va_list args; va_list args;

View File

@ -17,3 +17,7 @@ all: git-download
"$(MAKE)" -C $(PKG_BUILDDIR) "$(MAKE)" -C $(PKG_BUILDDIR)
include $(RIOTBASE)/pkg/pkg.mk include $(RIOTBASE)/pkg/pkg.mk
ifeq (llvm,$(TOOLCHAIN))
CFLAGS += -Wno-format-nonliteral
endif