Skip to content

Commit

Permalink
makefiles: Make attribute suggestions non-errors
Browse files Browse the repository at this point in the history
Different versions of GCC don't have different ideas about when the
suggestion should be made. That, combined with -Werror being enabled
results in spurious compilation failures for dumb reasons. They're
also really annoying when tinkering.

They do however make good suggestions on occasion so leave them enabled
with -Wno-error enabled so they don't cause compile failures.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
oohal committed Nov 14, 2019
1 parent 9e87ef7 commit d6fc2fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile.main
Expand Up @@ -42,7 +42,9 @@ HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-std=gnu11)
HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-m64)
HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \
$(call try-cflag,$(HOSTCC),-Wsuggest-attribute=const) \
$(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn)
$(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) \
$(call try-cflag,$(HOSTCC),-Wno-error=suggest-attribute=const) \
$(call try-cflag,$(HOSTCC),-Wno-error=suggest-attribute=noreturn)
HOSTCFLAGS += -DDEBUG -DCCAN_LIST_DEBUG

# We want small stack usage for skiboot
Expand Down Expand Up @@ -126,6 +128,8 @@ endif
CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \
$(call try-cflag,$(CC),-Wsuggest-attribute=const) \
$(call try-cflag,$(CC),-Wsuggest-attribute=noreturn) \
$(call try-cflag,$(CC),-Wno-error=suggest-attribute=const) \
$(call try-cflag,$(CC),-Wno-error=suggest-attribute=noreturn) \
$(call try-cflag,$(CC),-Wstack-usage=1024) \
$(call try-cflag,$(CC),-Wno-error=address-of-packed-member)

Expand Down

0 comments on commit d6fc2fb

Please sign in to comment.