bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: There is no returning


From: Bruce Korb
Subject: Re: There is no returning
Date: Sun, 10 Nov 2013 12:25:04 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9

On 11/10/13 12:41, Paul Eggert wrote:
A better solution, if you want to be portable to
MSVC, is to use _Noreturn instead of noreturn.
This is for reasons described in stdnoreturn.in.h.

'_Noreturn' is a bit ugly; if you don't care about
MSVC, then __attribute__((__noreturn__)) is
a good way to go.

Hi Paul,

Thanks.  As mentioned in the GCC pages, using the prefix/suffix
of "__" is the right way to go -- for Guile.  For me, I control
neither the gnulib variation on stdnoreturn.h nor the libguile/__scm.h
headers.  So rather than unwinding "noreturn" attributes for
functions that do not return, I'll hack up some really ugly stuff:

This:

if GL_GENERATE_STDNORETURN_H
$(STDNORETURN_H) : libguile/__scm.h
libguile/__scm.h :
        $(SHELL) $(srcdir)/fix-guile.sh $(LIBGUILE_CFLAGS)
endif

Plus this:

guile_scm_h=

while test $# -gt 0
do
    case "$1" in
    -I )
        test -f $2/libguile/__scm.h && {
            guile_scm_h=$2/libguile/__scm.h
            break
        }
        ;;
    -I* )
        f=${1#-I}
        test -f $f/libguile/__scm.h && {
            guile_scm_h=$f/libguile/__scm.h
            break
        }
        ;;
    esac
    shift
done

test -z "$guile_scm_h" && {
    guile_scm_h=/usr/include/libguile/__scm.h
    test -f $guile_scm_h || {
        echo "The Guile header __scm.h cannot be found"
        exit 1
    } 1>&2
}

test -d libguile || mkdir libguile || {
    echo "cannot make libguile directory"
    exit 1
} 1>&2

sed $'/^#define[ \t]SCM_NORETURN/s/RETURN..*/RETURN _Noreturn/' \
    $guile_scm_h > libguile/__scm.h



reply via email to

[Prev in Thread] Current Thread [Next in Thread]