[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: General gcc4.0 porting guide



On Fri, 2005-04-29 at 13:56 +0200, Ralf Ertzinger wrote:
> Hi.
> 
> Is there a general document showing common pitfalls when compiling a
> package with gcc4.0 (and how to resolve them)?
> 
> 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;


Nils
-- 
     Nils Philippsen    /    Red Hat    /    nphilipp redhat com
"They that can give up essential liberty to obtain a little temporary
 safety deserve neither liberty nor safety."     -- B. Franklin, 1759
 PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]