delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/10/20:20:00

Date: Wed, 10 Dec 1997 17:18:26 -0800 (PST)
Message-Id: <199712110118.RAA12583@adit.ap.net>
Mime-Version: 1.0
To: radon AT swipnet DOT se (Rikard =?iso-8859-1?Q?Bj=F6rklind?= ), djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Strange warning messageq

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019