Messages in this thread | | | Subject | Re: egcs-1.1.2 ping bug also causes miscompilation of pcbit isdn driver | Date | Mon, 14 Jun 1999 10:28:51 +0300 | From | Olaf Titz <> |
| |
> This behavior is *NOT* a bug in Egcs. A C compiler is free to reorder > the members of a structure (except the first one, and the last one if it
So how it is possible to write programs which access data structures in an externally prescribed binary format (e.g. filesystems, executable headers, communications protocols)? Does this standard effectively mean that the only way is *((foo *)base+pos) on char *base?
(I already have written code like that, but for a structure (in a comm protocol) which includes variable length fields in the middle, which you can't express in C at all.)
If so, C is more rotten than ever thought. It would mean that you can't have "struct ip" etc. any more. Standard or not, this is just absurd from a real world programmer's POV.
Olaf
- 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/
| |