git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Ævar Arnfjörð Bjarmason
Message 6 of 6 in “git-compat-util.h: Don't define NORETURN under __clang__”
  1. git-compat-util.h: Don't define NORETURN under __clang__Ævar Arnfjörð Bjarmason, Aug 3, 2010
  2. Michael J GruberAug 3, 2010
  3. Matthieu MoyAug 3, 2010
  4. Matthieu MoyAug 3, 2010
  5. Ævar Arnfjörð BjarmasonAug 3, 2010
  6. Benjamin KramerAug 3, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.