Re: egcs-1.1.2 ping bug also causes miscompilation of pcbit isdn drive

Horst von Brand (vonbrand@inf.utfsm.cl)
Wed, 16 Jun 1999 11:15:19 -0400


"Richard B. Johnson" <root@chaos.analogic.com> said:

[...]

> Wonderful. Now try that with local data on a push-up stack rather than
> the usual push-down stack.

Stacks usually grow downwards anyway...

> There is a requirement that pointer math work, i.e., char[1] be addressed
> at a higher offset value than char[0]. This has been interpreted to mean
> a higher memory location and it's not nocessarily so.

x + 1 < x. Wonderful.

> Given a communications packet such as TCP/IP......
>
> struct {
> HEADER hdr;
> char user_data[0];
> } IP;
>
> The assumption that this will always work is wrong (aside from the
> fact that a zero-length array is not allowed either.

This won't work if the machine places padding after header, but the packets
have been designed so that this normally won't happen. Plus this kind of
stuff is handled automagically by the system's headers, which needn't be
portable anyway.

-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/