Re: [AD] ISO C forbids conversion of function pointer to object pointer type

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Tatu Portin wrote:

Date: 23:30, 20. January 2005
Allegro version:  4.1.18
Environment: DJGPP 2.03
Compiler: GCC 3.4.3
Compiler options: -Wall -pedantic

Problem:
Compiling example extimer.c with line:

gcc -Wall -pedantic extimer.c -o extimer.exe

gives following warnings:

extimer.c:31: warning: ISO C does not allow extra `;' outside of a function extimer.c:41: warning: ISO C does not allow extra `;' outside of a function extimer.c:51: warning: ISO C does not allow extra `;' outside of a function


Thanks. I've fixed these as well as some other warnings and errors in the examples which show up with gcc -ansi -pedantic.

extimer.c: In function `main':
extimer.c:98: warning: ISO C forbids conversion of function pointer to object pointer type extimer.c:99: warning: ISO C forbids conversion of function pointer to object pointer type extimer.c:100: warning: ISO C forbids conversion of function pointer to object pointer type

Specially, "ISO C forbids conversion of function pointer to object pointer type" warnings have reproduced in newest versions of gcc. Warnings were not reproducible with gcc 3.3.1.


Not sure what to do about this. The (void *) cast could be changed to (intptr_t), but I'm not sure that's right.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/