From: Caolan McNamara (cmc at domain stardivision.de)
Date: Wed 10 May 2000 - 18:50:59 IST
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 10.05.00, 19:14:08, Paul Jakma <paulj at domain itg.ie> wrote regarding RE: [ILUG]
gcc optimisation weirdness?:
> Ken Frightened us with..
> > GCC also has some extensions that allow
> > you to do fancied stuff with initializers.
I knew that info was the spawn of satan, look at the evils that live in
there. Get out of that compiler extension section before you confuse the
hell out of me as to whats standard C and whats not.
> the : operator, right? don't remember exactly how it works, but something
> like:
> struct foo {
> int var : 0;
> char bar : NULL;
> } foobar;
> it used in a few places in the linux source.
These are not initializers, in this context : is to specify bitfields.
You can create a variable that refers to a unit whose size can be
specified in bits. (and before people go mad using the damn things, the
bitfields are collated together to form integral units (possible bytes,
probably 32bit ints) and they are as slow as molasses)
i.e.
int apple:4; creates a var apple which is 4bits long.
You would not see :NULL in reality and god only knows what :0 would do
C.
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:06 GMT