unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Jack Howarth <howarth@bromo.med.uc.edu>
Cc: 15807@debbugs.gnu.org
Subject: bug#15807: guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org clang < 3.3 properly
Date: Mon, 04 Nov 2013 22:00:36 -0500	[thread overview]
Message-ID: <87iow7mu23.fsf@netris.org> (raw)
In-Reply-To: <20131105005136.GA25087@bromo.med.uc.edu> (Jack Howarth's message of "Mon, 4 Nov 2013 19:51:36 -0500")

Jack Howarth <howarth@bromo.med.uc.edu> writes:

>     The guile 2.0.9 sources incorrectly assumes that sll clang compilers support
> the noreturn attribute which was only added in llvm.org clang 3.3 and Apple clang 5.0.
> In fink, we have fixed this with the following patch...
>
> --- guile-2.0.9/libguile/__scm.h.orig   2013-11-01 22:57:06.000000000 -0400
> +++ guile-2.0.9/libguile/__scm.h        2013-11-01 23:07:03.000000000 -0400
> @@ -76,7 +76,10 @@
>   * Examples:
>   *   1) int foo (char arg) SCM_NORETURN;
>   */
> -#ifdef __GNUC__
> +
> +#if (defined(__apple_build_version__) && (__clang_major__ < 5)) || ((__clang_major__ < 3) && (__clang_minor__ < 3))

The logic of these comparisons is incorrect.  Presumably you wanted the
test to be true for clang < 3.3.  However, it will be false for clang
versions 3.2 and 2.3.

Anyway, I don't want to include this complex version comparison logic
into __scm.h.  If we need to add something, it should be via an autoconf
test.

> +#define SCM_NORETURN
> +#elif defined(__GNUC__) 
>  #define SCM_NORETURN __attribute__ ((noreturn))
>  #else
>  #define SCM_NORETURN

So clang is pretending to be GCC (by defining __GNUC__), and then breaks
if we use the noreturn attribute which has been supported in GCC since
version 2.5 (released in 1993) ?  If so, I consider that a bug in clang.

For now, I've changed "__attribute__ ((noreturn))" to "__attribute__
((__noreturn__))", on the theory that the actual problem here is that
'noreturn' is being defined to _Noreturn by stdnoreturn.h.

Can you please try it and see if it fixes the problem?  Just because
clang doesn't support the ((noreturn)) attribute doesn't mean that it
necessarily aborts compilation if it sees it.

Please let us know how it goes.

    Thanks,
      Mark





  reply	other threads:[~2013-11-05  3:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  0:51 bug#15807: guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org clang < 3.3 properly Jack Howarth
2013-11-05  3:00 ` Mark H Weaver [this message]
2013-11-28 19:38   ` Ludovic Courtès
2014-01-15 20:12     ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iow7mu23.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=15807@debbugs.gnu.org \
    --cc=howarth@bromo.med.uc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).