bug-glpk
[Top][All Lists]
Advanced

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

Re: [Bug-glpk] compilation of lib_print_hook fails


From: Andrew Makhorin
Subject: Re: [Bug-glpk] compilation of lib_print_hook fails
Date: Sat, 9 Jun 2007 21:37:55 +0400

> with gcc 4.1.0 under Linux I get the following error when all warnings
> are turned on:
> gcc -O3 -fomit-frame-pointer -pipe -DNDEBUG -pedantic-errors -Wimplicit
> -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -MT
> glplib05.lo -MD -MP -MF .deps/glplib05.Tpo -c glplib05.c -fPIC -DPIC -o
> .libs/glplib05.o
> glplib05.c: In function '_glp_lib_print_hook':
> glplib05.c:151: error: ISO C forbids conversion of function pointer to
> object pointer type
> glplib05.c:151: error: ISO C forbids initialization between function
> pointer and 'void *'

> When I change line 151 of glpklib05.c
> from
> int (*hook)(void *, const char *) = (void *)func;
> into
> int (*hook)(void *, const char *) = (int(*)(void*, const char*))(func);

> then it works fine.
> (Hope its correct. I always get confused with function-pointers.)

Thank you for your bug report.

It is a bit strange, because (void *) must be compatible with pointers
of any types. The bug will be fixed in a next release.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]