[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-glpk] compilation of lib_print_hook fails
From: |
Stefan Vigerske |
Subject: |
[Bug-glpk] compilation of lib_print_hook fails |
Date: |
Sat, 9 Jun 2007 21:32:20 +0400 |
Hi,
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.)
Best,
Stefan
- [Bug-glpk] compilation of lib_print_hook fails,
Stefan Vigerske <=