History

-Wno-unused-result now added only on gcc >= 4.4

This option does not exist in gcc 4.3 and earlier, and it breaks the build on systems with older compilers. The makefile has been enhanced to test for the version and adds it only if a newer compiler is detected.

Milutin Jovanović committed 14 years ago

Commit e79c3531 parent 40a54c41 file · +12 −1Browse files

Unified · Split

Makefile+12−1
@@ -13,7 +13,18 @@ LDFLAGS_P=$(LDFLAGS) · 12 unmodified lines
1313 ifneq ($(GCC_MAJOR),2)
1414 CFLAGS+=-fno-strict-aliasing
1515 ifneq ($(GCC_MAJOR),3)
16−CFLAGS+=-Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
16+CFLAGS+=-Wno-pointer-sign -Wno-sign-compare
17+
18+# add -Wno-unused-result only on gcc >= 4.4
19+ifeq ($(GCC_MAJOR),4)
20+GCCGREATERTHEN44 := $(shell expr `gcc -dumpversion | cut -f2 -d.` \>= 4)
21+else
22+GCCGREATERTHEN44 := 1
23+endif
24+ifeq ($(GCCGREATERTHEN44),1)
25+CFLAGS+=-Wno-unused-result
26+endif
27+
1728 endif
1829 endif
1930

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t