Skip to content

Commit

Permalink
build: fix build warning anonymous structs avalable since C11
Browse files Browse the repository at this point in the history
clang: warning: anonymous structs are a C11 extension [-Wc11-extensions]
gcc:   warning: ISO C99 doesn’t support unnamed structs/unions [-Wpedantic]
  • Loading branch information
Alex Syrnikov authored and erthink committed Sep 28, 2020
1 parent aa64223 commit 8950799
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ CXX ?= g++

# T1HA_EXTRA_CFLAGS ?= -DT1HA_USE_INDIRECT_FUNCTIONS=0 -m32

CFLAGS ?= $(T1HA_EXTRA_CFLAGS) -std=c99 -O3 -DNDEBUG -D_DEFAULT_SOURCE -fno-stack-protector
CXXFLAGS = -std=c++11 $(filter-out -std=c99,$(CFLAGS))
CFLAGS ?= $(T1HA_EXTRA_CFLAGS) -std=c11 -O3 -DNDEBUG -D_DEFAULT_SOURCE -fno-stack-protector
CXXFLAGS = -std=c++11 $(filter-out -std=c11,$(CFLAGS))

TARGET_ARCH_e2k ?= $(shell (export LC_ALL=C; ($(CC) --version 2>&1; $(CC) -v 2>&1) | grep -q -i 'e2k' && echo yes || echo no))
TARGET_ARCH_ia32 ?= $(shell (export LC_ALL=C; ($(CC) --version 2>&1; $(CC) -v 2>&1) | grep -q -i -e '^Target: \(x86_64\)\|\([iI][3-6]86\)-.*' && echo yes || echo no))
Expand Down Expand Up @@ -232,5 +232,5 @@ cross-qemu:
@echo " 2) apt install binfmt-support qemu-user-static qemu-user qemu-system-arm qemu-system-mips qemu-system-misc qemu-system-ppc qemu-system-sparc"
@for CC in $(CROSS_LIST); do \
echo "===================== $$CC + qemu"; \
$(MAKE) clean && CC=$$CC CXX=$$(echo "$$CC" | sed 's/gcc/g++/') CFLAGS_TEST="-std=c99 -static" $(MAKE) bench-verbose || exit $$?; \
$(MAKE) clean && CC=$$CC CXX=$$(echo "$$CC" | sed 's/gcc/g++/') CFLAGS_TEST="-std=c11 -static" $(MAKE) bench-verbose || exit $$?; \
done

0 comments on commit 8950799

Please sign in to comment.