<div dir="ltr"><div>Hi all!</div><div><br></div><div>I've accidentally found a "mistake" in lib/timer.c (master branch). Mistake in quotes, because it is rather a configuration mistake, as I found later. There is a function prototype definition inside "#ifdef USE_PTHREADS", which is then used outside of it, but in "#ifdef CONFIG_BFD":</div><div><br></div><div>#ifdef USE_PTHREADS<br>...</div><div>void wakeup_kick_current(void);<br>#else<br>...</div><div>#endif<br>...</div><div>void<br>tm_set(timer *t, btime when)<br>{<br>...</div><div>#ifdef CONFIG_BFD<br>  /* Hack to notify BFD loops */<br>  if ((loop != &main_timeloop) && (t->index == 1))<br>    wakeup_kick_current();<br>#endif<br>}<br><br></div><div>So in case USE_PTHREADS is not defined and CONFIG_BFD is defined, the compilation would fail with implicit function declaration error. It could be reproduced with:</div><div><br></div><div>./configure --disable-pthreads --with-protocols=bfd</div><div>make</div><div>...</div><div>lib/timer.c: In function 'tm_set':<br>lib/timer.c:165:5: error: implicit declaration of function 'wakeup_kick_current' [-Wimplicit-function-declaration]<br>  165 |     wakeup_kick_current();<br>      |     ^~~~~~~~~~~~~~~~~~~<br>make: *** [Makefile:115: obj/lib/timer.o] Error 1<br><br></div><div>But even moving that function prototype out of "#ifdef USE_PTHREADS" does not help. It then fails on proto/bfd/io.c using undefined references, because it uses pthreads unconditionally.</div><div><br></div><div>I think it would be better to fail on "configure" stage with a meaningful message that bfd requires pthreads. I see there is now only a workaround to exclude bfd from the default set of protocols if pthreads is not enabled. I've made some patch that shows an error if bfd is enabled and pthreads support is disabled.</div><div><br></div><div>Regards,</div><div>Alexander Zubkov</div></div>