[Top][All Lists]

[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 11:31:10 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9

On 11/10/13 00:13, Harlan Stenn wrote:

I'm seeing build errors on psp-fb1 with the guile headers as well, and 

Errors like this:

/usr/bin/gcc-4.6 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I.. -I../autoopts \
  -g -O2 -MT autogen-ag.o -MD -MP -MF .deps/autogen-ag.Tpo -c -o autogen-ag.o \
`test -f 'ag.c' || echo './'`ag.c
In file included from /usr/include/libguile.h:40:0,
                 from autogen.h:60,
                 from ag.c:7:
/usr/include/libguile/error.h:39:24: error: expected ')' before '__attribute__'
/usr/include/libguile/error.h:39:24: error: expected ',' or ';' before ')' token

The cause seems to be a bad interaction between gnulib's stdnoreturn module
and the Guile headers.  I'm chasing that now.

# 28 "/usr/include/libguile/error.h" 3 4
extern SCM scm_system_error_key;
extern SCM scm_num_overflow_key;
extern SCM scm_out_of_range_key;
extern SCM scm_args_number_key;
extern SCM scm_arg_type_key;
extern SCM scm_memory_alloc_key;
extern SCM scm_misc_error_key;

extern void scm_error (SCM key, const char *subr, const char *message,
   SCM args, SCM rest) __attribute__ ((__attribute__ ((__noreturn__))));

from the generated stdnoreturn.h:

/* The definition of _Noreturn is copied here.  */
#if !defined _Noreturn && __STDC_VERSION__ < 201112
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
      || 0x5110 <= __SUNPRO_C)
#  define _Noreturn __attribute__ ((__noreturn__))
# elif 1200 <= _MSC_VER
#  define _Noreturn __declspec (noreturn)
# else
#  define _Noreturn
# endif
# define noreturn _Noreturn

And looking into Guile sources:

$ find /usr/include/libguile -type f|xargs grep -Ei '^#define.*noreturn'
/usr/include/libguile/__scm.h:#define SCM_NORETURN __attribute__ ((noreturn))

So "noreturn" gets #define-d to:  __attribute__ ((__noreturn__))
and SCM_NORETURN is:  __attribute__ ((noreturn))

Too clever by way more than half.  The correct fix is not obvious to me.
It seems like the correct attribute spelling is:  __attribute__ ((__noreturn__))
but the Guile code spells it in a way whereby gnulib "fixes" the thing.

No way out.

reply via email to

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