General gcc4.0 porting guide

Ralf Ertzinger fedora at camperquake.de
Fri Apr 29 12:10:29 UTC 2005


Hi.

Nils Philippsen <nphilipp at redhat.com> wrote:

> > For example, what is the "right" way to deal with this:
> > 
> > int* foo;
> > 
> > [...]
> > ((short int*)foo)++;  // gcc4 does not like this.
> 
> 1) Fix the code in question (why is there a cast to short) ;-)
> 
> 2) perhaps:
> 
>   *foo = ((short int) (*foo)) + 1;

Unless I am very much mistaken (my C-fu is weak), this is not the
same. The code I posted is pointer arithmetic.

-- 
"You didn't want software written by a calm, happy, non-paranoid
individual to be answering port 25 anyway."  -- Anthony DeBoer




More information about the fedora-extras-list mailing list