[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile-snarf chokes on -g3 flag
From: |
Mike Gran |
Subject: |
guile-snarf chokes on -g3 flag |
Date: |
Fri, 11 Mar 2011 09:07:18 -0800 (PST) |
Hi,
When compiling guile with the gcc -g3 flag, compilation of alist.c fails
with the following error
In file included from alist.c:379:0:
../libguile/alist.x: In function 'scm_init_alist':
../libguile/alist.x:2:1: error: 'X' undeclared (first use in this function)
../libguile/alist.x:2:1: note: each undeclared identifier is reported only
once for each function it appears in
The aforementioned 'X' appears in the second line of the alist.x file. The
second line
contains only "X;"
alist.x begins with...
/* cpp arguments: alist.c -DHAVE_CONFIG_H -DBUILDING_LIBGUILE=1
-I.. -I.. -I../lib -I../lib -I/usr/lib64/libffi-3.0.9/include
-g3 -gdwarf-2 -O0 -Wall */
X;
scm_acons__name = scm_string_to_symbol (scm_acons__name_string);
So, when you compile something -g3, the temporary file generated
by this command in the guile-snarf script is different than when
compiled in -g2
${cpp} -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@"
This is because it includes explicitly all the #defines
So, that means that it also includes the following line in
the /tmp/guile-snarf.XXXX/tmp file
#define SCM_SNARF_INIT(X) ^^ X ^:^
The new sed script converts that into "X;"
To convince yourself of this fact, you can run a debug version
of the sed script like so
sed -ne "s/ *\^ *: *\^/\n/;s/[^\n]*\^ *\^ *\([^\n]*\)/\1;/;tx;d;:x;=;l;D"
I don't know the best way to fix it, but you could brute force the fix
like the attached patch
0001-Don-t-snarf-definition-of-SCM_SNARF_INIT.patch
Description: Text Data
- guile-snarf chokes on -g3 flag,
Mike Gran <=