Created attachment 371634 [details] build log Upgrading dev-lang/swi-prolog from 7.1.7 to 7.1.8, I got the following error: os/pl-rl.c:99:1: error: unknown type name ‘Function’ os/pl-rl.c:99:18: error: conflicting types for ‘rl_event_hook’ In file included from os/pl-rl.c:87:0: /usr/include/readline/readline.h:569:24: note: previous declaration of ‘rl_event_hook’ was here os/pl-rl.c: In function ‘Sread_readline’: os/pl-rl.c:450:16: warning: assignment from incompatible pointer type [enabled by default] Makefile:183: recipe for target 'os/pl-rl.o' failed The file in question, os/pl-rl.c, has not changed between these versions. Indeed, remerging 7.1.7 fails with the same error. This appears to be due to a readline upgrade. Between 6.2_p5-r1 and 6.3, the following was removed from /usr/include/readline/rltypedefs.h: /* Old-style */ #if !defined (_FUNCTION_DEF) # define _FUNCTION_DEF typedef int Function (); typedef void VFunction (); typedef char *CPFunction (); typedef char **CPPFunction (); #endif /* _FUNCTION_DEF */ So this is where the Function type comes from. The global variable rl_event_hook is declared in readline.h as extern rl_hook_func_t *rl_event_hook; which according to rltypedefs.h is typedef int rl_hook_func_t PARAMS((void)); So perhaps the correct fix would be using that type. Since the latest readline:0 is 6.2_p1 which already does provide that rl_hook_func_t typedef, I guess we don't need any support for older readline versions.
Other packages are affected by this as well, see e.g. bug 503180.
Can confirm this bug. Simply deleting line 99 from os/pl-rl.c fixes the problem, since the correct declaration is already available in readline.h. I've also reported the bug upstream: http://www.swi-prolog.org/bugzilla/show_bug.cgi?id=162
Thanks for reporting this bug. I've patched pl-6.6.2 and pl-7.1.9 with upstream commit e23683d2 [1] [1] http://www.swi-prolog.org/git/pl.git/commit/e23683d2