[Ecls-list] GCC's builtins
Stelian Ionescu
sionescu at cddr.org
Thu Feb 4 16:38:06 UTC 2010
On Thu, 2010-02-04 at 00:39 +0100, Juan Jose Garcia-Ripoll wrote:
> I am experimenting again with tagging certain function and branches
> using GCC's builtin attributes.
>
>
> For instance, FEprogram_error is now tagged __attribute__((noreturn))
> indicating that it is a function that does not return.
>
>
> These attributes existed before in ECL's code, but GCC was broken at
> some point and interpreted "noreturn" also as "nolongjmp". This broke
> code that captures errors using UNWIND-PROTECT, HANDLER-CASE, etc.
>
>
> As of GCC 4.* a "noreturn" function is explicitely allowed to use
> "longjmp" to return to the caller. I would love to simply uncomment
> all __attribute__((noreturn)), but 1) there is the chance that this is
> still broken in some corner cases or 2) some people may try to build
> ECL using GCC 3.4, for instance. Hence my approach is now
> conservative, using ((noreturn)) only on functions that are called
> from other functions that do not use those protection mechanisms.
> Perhaps this is too conservative.
Using gcc 4.4.2 on Linux/x86, Boehm 7.2alpha4, ECL configured like this:
--with-system-gmp --enable-boehm=system --enable-gengc
--enable-precisegc --enable-longdouble --without-debug-cflags
--enable-threads --with-__thread --enable-unicode --without-x
--without-clx
I get warnings like these(complete log at http://tinyurl.com/y9g5xwa):
/home/hechee/tmp/ecl/src/c/error.d: In function 'init_error':
/home/hechee/tmp/ecl/src/c/error.d:327: warning: passing argument 2 of 'ecl_def_c_function_va' from incompatible pointer type
./ecl/external.h:412: note: expected 'cl_objectfn' but argument is of type 'union cl_lispunion * (*)(cl_narg, union cl_lispunion *, union cl_lispunion *, union cl_lispunion *)'
/home/hechee/tmp/ecl/src/c/error.d: In function 'FEinvalid_function':
/home/hechee/tmp/ecl/src/c/error.d:223: warning: 'noreturn' function does return
/home/hechee/tmp/ecl/src/c/error.d: In function 'FEwrong_num_arguments_anonym':
/home/hechee/tmp/ecl/src/c/error.d:199: warning: 'noreturn' function does return
/home/hechee/tmp/ecl/src/c/error.d: In function 'FEwrong_num_arguments':
/home/hechee/tmp/ecl/src/c/error.d:193: warning: 'noreturn' function does return
/home/hechee/tmp/ecl/src/c/error.d: In function 'FEundefined_function':
/home/hechee/tmp/ecl/src/c/error.d:179: warning: 'noreturn' function does return
/home/hechee/tmp/ecl/src/c/read.d: In function 'read_VV':
/home/hechee/tmp/ecl/src/c/read.d:2469: warning: passing argument 1 of 'ecl_make_cfun' from incompatible pointer type
./ecl/external.h:406: note: expected 'cl_objectfn_fixed' but argument is of type 'cl_objectfn'
/home/hechee/tmp/ecl/src/c/unixint.d: In function 'si_catch_signal':
/home/hechee/tmp/ecl/src/c/unixint.d:712: warning: passing argument 2 of 'mysignal' from incompatible pointer type
/home/hechee/tmp/ecl/src/c/unixint.d:209: note: expected 'void (*)(int, struct siginfo_t *, void *)' but argument is of type 'void (*)(int)'
dpp: /home/hechee/tmp/ecl/src/c/threads.d -> tmp.c
Keyword not found: count.
Unknown symbol: mp:make-semaphore
Unknown symbol: mp:make-semaphore
Unknown symbol: mp::semaphore
Unknown symbol: mp::semaphore
Unknown symbol: mp::semaphore
Unknown symbol: mp::semaphore
Btw, colorgcc(http://schlueters.de/colorgcc.html) is very useful in
spotting warnings/errors in long builds
--
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100204/bab7e970/attachment.sig>
More information about the ecl-devel
mailing list