[Ecls-list] Re: Bunch of fixes

Paul F. Dietz dietz at dls.net
Mon Mar 17 18:23:19 UTC 2003


I wrote:

> It looks like you're trying to put a local variable declaration after
> a statement, which is illegal in C (but not in C++).

The macro saveTEST is defined by:

#define saveTEST  \
	cl_object old_test_function = test_function;  \
	cl_object old_item_compared = item_compared;  \
	bool (*old_tf)(cl_object) = tf;  \
	cl_object old_key_function = key_function;  \
	cl_object (*old_kf)(cl_object) = kf;

It is used in:

#line 553
cl_object cl_subst(int narg, cl_object new_obj, cl_object old_obj, cl_object tree, ...)
{
#line 553

	saveTEST;
#line 556
	static cl_object KEYS[3] = {(cl_object)(cl_symbols+1162), (cl_object)(cl_symbols+1163), 
(cl_object)(cl_symbols+1129)};


Note the extra semicolon!  There's a null statement inserted after cl_object (*old_kf)(cl_object) = 
kf;, so the static keyword is improperly placed.

The macro should have been defined as:

#define saveTEST  \
	cl_object old_test_function = test_function;  \
	cl_object old_item_compared = item_compared;  \
	bool (*old_tf)(cl_object) = tf;  \
	cl_object old_key_function = key_function;  \
	cl_object (*old_kf)(cl_object) = kf   /* <==== note absence of semicolon */

------------

	Paul






More information about the ecl-devel mailing list