Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Bartc <bc@freeuk.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: How does strict aliasing work with parallel arrays in a union or const-initialized data |
| Date | 2015-10-29 10:55 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <n0stru$plq$1@dont-email.me> (permalink) |
| References | (4 earlier) <b49266e4-9532-4179-9d4c-fd2c02d7236b@googlegroups.com> <lnlhambmrj.fsf@kst-u.example.com> <kfnoafibkpk.fsf@x-alumni2.alumni.caltech.edu> <lnh9labhuv.fsf@kst-u.example.com> <342e8770-35cb-4f9c-ad01-8a660c12d97d@googlegroups.com> |
On 29/10/2015 03:02, supercat@casperkitty.com wrote: > I wish C would honor its history as a systems-programming language and let > programmers excercise control over struct layouts. I think you can. You can use something like #pragma pack(1). Then it will use byte alignment for all fields, and it is up to you to space things out by selecting member sizes and inserting padding. But the explicit padding will add extra fields which will affect things like initialisation. (Outside of I've always used byte alignment, which means carefully crafting a struct layout if I care about alignment or overall size. When converting one byte-aligned language to high-level C, then it simplest to turn on #pragma pack(1) and let C lay things out my way, than to try and predict what C will do.) -- Bartc
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-21 16:47 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-24 21:20 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-25 11:44 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-28 12:15 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-28 14:25 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-28 16:23 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-28 17:08 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-28 18:09 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-28 20:02 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Bartc <bc@freeuk.com> - 2015-10-29 10:55 +0000
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-29 06:50 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-29 08:52 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-31 10:21 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-29 08:50 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-29 12:25 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-30 13:02 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-30 13:35 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-30 19:57 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-31 12:27 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-30 17:02 -0400
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-30 14:16 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-31 08:13 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-31 08:42 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-10-31 10:40 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-02 01:45 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-11-02 06:57 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-02 08:12 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-11-02 08:54 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-04 07:24 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-11-04 09:22 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-04 19:48 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-11-05 09:44 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-07 10:17 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data raltbos@xs4all.nl (Richard Bos) - 2015-11-10 15:37 +0000
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data supercat@casperkitty.com - 2015-11-10 09:01 -0800
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-28 16:48 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Keith Thompson <kst-u@mib.org> - 2015-10-28 16:11 -0700
Re: How does strict aliasing work with parallel arrays in a union or const-initialized data Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-28 16:37 -0700
csiph-web