Re: [Sablevm-developer] Errno usage considered harmful?!
Brought to you by:
egagnon
From: Grzegorz B. P. <ga...@de...> - 2004-03-14 06:18:10
|
W li=B6cie z =B6ro, 10-03-2004, godz. 08:26, Clark VERBRUGGE pisze:=20 > I have some guesses, below. > Try just using the include and removing the "extern int errno;" > statement. Works, indeed. > > 2. In interrupt() implementation I use a pointer to pthread_cond_t: > > volatile pthread_cond_t *sleeping_on_cond; > > I also keep getting this warning: > > java_lang_VMThread.c:342: warning: passing arg 1 of > > `pthread_cond_broadcast' discards qualifiers from pointer target > type > > which is such code: > > pthread_cond_broadcast (env_other->thread.sleeping_on_cond); >=20 > The prototype for cond_broadcast doesn't expect a volatile type for > the argument, so that qualifier is being discarded when you call the > function. > An explicit cast may eliminate the warning, but the problem is that > the cond_broadcast code was not compiled assuming volatile input > arguments. =20 >=20 > If that's a problem then you'll need to re-examine why you need > volatile in sleeping_on_cond. Good hint. The problem was, that I wanted volatile _pointer_ to pthread_cond_t, not a pointer to volatile pthread_cond_t. I changed the declaration to sth. like: pthread_cond_t *volatile sleeping_on_cond; and the warnings are all gone. Thanks a lot, Grzegorz B. Prokopski --=20 Grzegorz B. Prokopski <ga...@de...> Debian GNU/Linux http://www.debian.org SableVM - LGPLed JVM http://www.sablevm.org Why SableVM ?!? http://devel.sablevm.org/wiki/WhySableVM |