This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

showstopper bug : guile and C++



apparently, g++ doesn't like the way SCM_VALIDATE is called.

	#include <libguile.h>

	int foo()
	{
	  SCM foo;
	  int t = SCM_CELL_WORD_0(foo);

	  return t;
	}


	cd /users/hanwen/usr/src/lilypond/
	g++ -Wall -I/tmp/include foo.cc
	foo.cc: In function `int foo()':
	foo.cc:6: converting to `void' from `int'
	foo.cc:6: converting to `void' from `int'

	Compilation exited abnormally with code 1 at Fri Jun  9 19:18:01


suggestion: use the following in gc.h

	#if SCM_DEBUG_CELL_ACCESSES == 1
	#define DO_VALIDATE (SCM_VALIDATE_CELL (x)), 
	#else
	#define DO_VALIDATE 
	#endif 

	#define SCM_CELL_WORD(x, n) \
	     ( DO_VALIDATE\
	     (((scm_bits_t *) SCM2PTR (x)) [n]) )

-- 

Han-Wen Nienhuys, hanwen@cs.uu.nl ** GNU LilyPond - The Music Typesetter 
      http://www.cs.uu.nl/people/hanwen/lilypond/index.html 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]