Re: [RFC/PATCH] git-compat-util.h: Don't define NORETURN under __clang__
- From
Benjamin Kramer <benny.kra@googlemail.com>
- Date
- Aug 3, 2010, 13:35 UTC
- Message-ID
- <C210797E-AE95-4074-AADE-CD2B518D8202@gmail.com>
- In-Reply-To
- <1280840883-24540-1-git-send-email-avarab@gmail.com>
On 03.08.2010, at 15:08, Ævar Arnfjörð Bjarmason wrote:
> clang version 1.0 on Debian testing x86_64 defines __GNUC__, but barfs > on `void __attribute__((__noreturn__))'. E.g.:
This is a bug in clang 1.0 that was fixed in the llvm 2.7/clang 1.5 timeframe, it didn't recognize attributes on function pointers properly. clang tries to be as compatible with GCC as possible so it obviously has to define __GNUC__ ;)
Show 6 quoted lines
> > usage.c:56:1: error: function declared 'noreturn' should not return [-Winvalid-noreturn] > } > ^ > 1 diagnostic generated. > make: *** [usage.o] Error 1
It's a "warning which defaults to an error" you can pacify it by passing -Winvalid-noreturn or -Wno-invalid-noreturn.
I oppose adding workarounds for obsolete versions of clang, Debian should upgrade their packages to a more recent release. clang 1.0 had all kinds of weird bugs and shouldn't be used anymore.