chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Add aggressive debugging checks to squash


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Add aggressive debugging checks to squash those damn bugs
Date: Sun, 6 Oct 2013 17:06:00 +0200
User-agent: Mutt/1.4.2.3i

On Sun, Sep 29, 2013 at 10:46:25PM +0200, Peter Bex wrote:
> The first patch adds assertions to all the type accessors like C_unfix,
> C_block_{header,item}, C_character_code etc.  It does this through a
> "check" macro which contains a horrible, evil hack which allows LET-like
> semantics in C macros, in a bit of a manual way.

Unfortunately, complex statement expressions do not sit well with clang
and G++.  This causes compiler errors when compiling CHICKEN, eggs or
programs with these compilers.  Even when gcc is used, chicken.h can be
included in C++ programs, like for example in the case of "crunch"
programs or libraries, like sixty-five-oh-two.

I've attempted to rewrite this to use the clang block syntax, but that
adds more annoyances: you'll need to link against a special LLVM runtime,
and pass the -fblocks option, which is not recognised by other compilers.
So it's probably not worth it, and the attached patch disables the
paranoid debugging code for clang and c++ compilers completely.

If anyone has ideas of how to support these compilers properly (maybe
C++ can be supported via C++11 lambdas?), feel free to tackle it.

It's disappointing and annoying that this does not work with clang :(
so I'd really appreciate it if someone more familiar with its inner
workings could take a closer look at why it's not working.  Its fabled
good error reporting did not really help much.

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Disable-paranoid-code-for-clang-C-due-to-limited-sup.patch
Description: Text document


reply via email to

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