Mail Archives: djgpp/1997/12/10/20:20:00
At 06:56 12/10/1997 GMT, Rikard Björklind wrote:
>Tony O'Bryan wrote:
>
>>Not without seeing the exact error. The fragment you provided might be
>>part of the warning given when the programmer tries to assign a pointer
>>to an integer.
>
>Okay, here it is:
>warning: assignment makes pointer from integer without a cast
>and here is the code:
>---
>#include <sys/nearptr.h>
>
>char *screen;
>
>main() {
>asm ("movw $0x0013,%ax");
>asm ("int $0x10");
>
>if (__djgpp_nearptr_enable() == 0) return 1;
>screen = 0xa0000 + __djgpp_conventional_base;
You do indeed make a pointer from an integer without a cast. 0xa0000 is an
integer, `__djgpp_conventional_base' is an integer, and `screen' is a
pointer. Easy to fix, though; use a cast.
screen = (char *) 0xa0000 + __djgpp_conventional_base;
Nate Eldredge
eldredge AT ap DOT net
- Raw text -