Avoiding "assignment from incompatible pointer type" warning
Joshua Nye
josh@boxcarmedia.com
Sun Oct 13 15:19:00 GMT 2002
If what you mean about being 'illegal' is that it will not compile, it will
compile. Good programming practice is another thing altogether.
--josh
----- Original Message -----
From: "Florian Weimer" <fw@deneb.enyo.de>
To: "Joshua Nye" <josh@boxcarmedia.com>
Cc: "Steve Dondley" <s@dondley.com>; <gcc-help@gcc.gnu.org>
Sent: Sunday, October 13, 2002 6:09 PM
Subject: Re: Avoiding "assignment from incompatible pointer type" warning
> "Joshua Nye" <josh@boxcarmedia.com> writes:
>
> > What you're looking for is a cast. i.e.:
> >
> > int *p;
> > float g = 3.141592653589793238;
> > p = (int *)&g;
>
> Is this code legal? I doubt it.
>
More information about the Gcc-help
mailing list