On Sat, Apr 06, 2002 at 02:34:08PM -0800, James Morrison wrote:
> Hi,
>
> gcc3 produces warnings for code that looks like:
> major = ntohl (*p++);
> where p is a pointer. There is a lot of code that looks like this in
> hurd/nfs.
> would the fix look like:
> major = ntohl (*p); p++;
We will never do anything like this.
> or
> major = ntohl (*p);
> p++;
This is acceptable.
> or
> major = ntohl (p[0]);
> ...
> p = &p[2];
I consider this to be awkward.
The simplest way is probably to add parenthesis:
major = ntohl (*(p++));
This works fine, and I use it in all my code since I use gcc 3.0.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann GNU http://www.gnu.org [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de
_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd