On Sun, Aug 30, 2009 at 12:20:10PM +0200, gianrico wrote:
>    I'm using gcc 4.4.0 in Fedora 11 and have the same error.
> I have this error in many places.
> The error is in C code like this:
> 
> (char *)buf +=2;
> 
> The question is that I think this should  not be standard C code because the
> cast conversion is temporary.
> 
> It could happen that in the "next line of code"  buf is unchanged!
> 
> I resolved this issue change the type of 'buf' to 'char *' instead of 'void 
> *'. 
> 
> But I'M NOT SURE THAT THE CODE IT WILL BE STABLE. It should be tested.

The result of a cast is not an lvalue, so it should be done as:

        buf = (void *) ( 2 + (char*)buf );

Steve

-- 
Stephen J Friedl  | Security Consultant |  UNIX Wizard  | 714 694-0494
[email protected] | Orange County, CA   | Microsoft MVP |  unixwiz.net
_______________________________________________
Flow-tools mailing list
[email protected]
http://mailman.splintered.net/mailman/listinfo/flow-tools

Reply via email to