[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble with guile-snarf and clang-3.4's preprocessor
From: |
Ludovic Courtès |
Subject: |
Re: Trouble with guile-snarf and clang-3.4's preprocessor |
Date: |
Mon, 10 Mar 2014 14:20:27 +0100 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
Mark H Weaver <address@hidden> skribis:
> Here's the definition of SCM_VARIABLE from snarf.h:
>
> #define SCM_VARIABLE(c_name, scheme_name) \
> SCM_SNARF_HERE(static SCM c_name) \
> SCM_SNARF_INIT(c_name = scm_c_define (scheme_name, SCM_BOOL_F);)
>
> When guile-snarf is run to generate ports.x, SCM_MAGIC_SNARF_INITS is
> defined, so the following definitions are active:
>
> # define SCM_SNARF_HERE(X)
> # define SCM_SNARF_INIT_PREFIX ^^
> # define SCM_SNARF_INIT(X) SCM_SNARF_INIT_PREFIX X ^:^
> # define SCM_SNARF_DOCS(TYPE, CNAME, FNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING)
>
> So you might expect the definition of 'default_conversion_strategy_var'
> in ports.c to expand into something like this:
>
> ^^ default_conversion_strategy_var = scm_c_define
> ("%default-port-conversion-strategy", SCM_BOOL_F); ^:^
>
> However, clang -E inserts 6 newlines between the open paren and the open
> quote above. Unfortunately, afaict, the 'sed' script in the
> 'modern_snarf' function in 'guile-snarf' cannot cope with any newlines
> between the "^^" and "^:^".
Woow, good catch!
It’s surprising no other C compiler out there ever had this problem.
Ludo’.