pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lang/gprolog: PR 45002: function pointer doesn't initialize through static variable assignment?



Some background:

I am trying to compile lang/gprolog on NetBSD 6.0/i386.

I get the same error depicted in PR http://gnats.netbsd.org/45002 which
seems open for long.

Also tried upgrading to more recent version of gprolog i.e. 1.4.2, though
the same error persists.

Interestingly, I see gprolog running fine on NetBSD 4.0.1/amd64. Wonder
why this problem didn't occur on 4.0.x.

A brief analysis of the problem:

(Note: line numbers are with respect to gprolog 1.4.2, though the relevant
code is same in pkgsrc's 1.3.x as well.)

Following check in EnginePl/if_no_fd.c succeeds as the function pointer
pl_fd_init_solver is not initialized. Due to this the program (gplc) exits
with runtime error. (gplc is run during the build itself, so build fails.)

 82 void
 83 Pl_Fd_Init_Solver(void)
 84 {
 85   if (pl_fd_init_solver == NULL)    /* FD solver not linked */
 86     {


The code that initializes the same is in EngineFD/fd_inst.c

 165 void (*pl_fd_init_solver) () = Pl_Fd_Init_Solver0;  /* overwrite var of 
if_no_fd.c */
 166 void (*pl_fd_reset_solver) () = Pl_Fd_Reset_Solver0;    /* overwrite var 
of if_no_fd.c */

Above are just external declarations, not inside any function and seems
this code is not hitting prior to the one above getting executed.

Does this give any hint or clue to you, please do post your inputs that
will help analyze this problem further.

Also posted upstream. No response yet. NetBSD is listed as a supported
platform on their site.

Mayuresh.


Home | Main Index | Thread Index | Old Index