LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] gcc optimisation weirdness?

[ILUG] gcc optimisation weirdness?

Caolan McNamara cmc at stardivision.de
Wed May 10 18:50:59 IST 2000


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 10.05.00, 19:14:08, Paul Jakma <paulj at 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.




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell