From: Bernd Paysan on 12 May 2010 11:37 Nicholas King wrote: > On 05/13/2010 12:30 AM, nmm1(a)cam.ac.uk wrote: >> C's volatile is a disaster area. > Can't we shorten this to "C's a disaster area."? I suggest that C compiler writers create a switch for highest possible optimization: -Oinfinity. In -Oinfinity mode, the generated code will output the same data as one of the SPEC benchmarks, and which one it chooses depends on the linker target name. If the linker target name does not match any of the SPEC benchmark programs, it will use a local zero-day root exploit and wipe your hard disk to remove any evidence of its crime. -- Bernd Paysan "If you want it done right, you have to do it yourself!" http://www.jwdt.com/~paysan/
From: Rick Jones on 12 May 2010 15:58 Andy 'Krazy' Glew <ag-news(a)patten-glew.net> wrote: > On 5/11/2010 10:28 AM, Joe Pfeiffer wrote: > > Yes, except order of the fields in the struct is up to the > > compiler. We can have pointers to the offsets put in by hand. > IIRC in C the fields must be in the order specified by the > programmer. Anyone remember "the art hack?" rick jones -- The computing industry isn't as much a game of "Follow The Leader" as it is one of "Ring Around the Rosy" or perhaps "Duck Duck Goose." - Rick Jones these opinions are mine, all mine; HP might not want them anyway... :) feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
From: James Harris on 12 May 2010 17:28 On 12 May, 03:52, Andy 'Krazy' Glew <ag-n...(a)patten-glew.net> wrote: .... > IIRC in C the fields must be in the order specified by the programmer. Of course, what does that mean if you are > accessing a big endian device on a little endian machine? As for bitfields... > > However, the padding and alignment restrictions can differ. AIUI structs in C can be used if they are restricted to simple integers of various widths and are then subdivided by the programmer. Code such as the following should help. http://codewiki.wikispaces.com/bitfield_operations.c As for byte endianness there are links at the bottom of that page to code which will change endianness if needed. James
From: Tim McCaffrey on 13 May 2010 19:10
In article <hsbram$k01$1(a)news.m-online.net>, bernd.paysan(a)gmx.de says... > The only thing missing is the channel controller >or similar - the solution of the problem by offloading it to a special- >purpose hardware. > That was called I2O, and several vendors support variations of it, usually for disk/RAID controllers. - Tim |