Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #4365

Re: word size and gcc builtins usage

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!feeder.news-service.com!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: word size and gcc builtins usage
Date Fri, 20 May 2011 08:24:43 +1200
Lines 17
Message-ID <93lckbF1bbU7@mid.individual.net> (permalink)
References <9eaee802-67e8-44a8-a88d-da20f0381bcc@j13g2000pro.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net 1nYWO80i7wJ7oUGDvaKf/wrSiiYK6hhsh6QBWUcbZ7sD+uYW/C
Cancel-Lock sha1:Tsb44QrONzCmQz8IkZUe7v+LqcQ=
User-Agent Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4
In-Reply-To <9eaee802-67e8-44a8-a88d-da20f0381bcc@j13g2000pro.googlegroups.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c:4365

Show key headers only | View raw


On 05/20/11 08:12 AM, dr.oktopus wrote:
> Hello,
> simple question: what is the most appropriate type for implement a bit
> array type for
> operations like anding, oring, etc..
> simple answer: well, it should be the word size of the microprocessor
> you are using.
> More exactly, it should be the largest word the os allow you. So, if
> you are running
> x86 linux on a 64-bit microprocessor, it is 32 bit. But how detect it?

Why 32 bit?  unsigned long is 64 bit on that platform.

Using size_t probably meets your requirements.

-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

word size and gcc builtins usage "dr.oktopus" <blindwilly@freeonline.zzn.com> - 2011-05-19 13:12 -0700
  Re: word size and gcc builtins usage Ian Collins <ian-news@hotmail.com> - 2011-05-20 08:24 +1200
    Re: word size and gcc builtins usage Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-05-22 13:06 +0000
  Re: word size and gcc builtins usage "Joel C. Salomon" <joelcsalomon@gmail.com> - 2011-05-19 14:21 -0700
    Re: word size and gcc builtins usage "robertwessel2@yahoo.com" <robertwessel2@yahoo.com> - 2011-05-19 18:13 -0700
  Re: word size and gcc builtins usage Seebs <usenet-nospam@seebs.net> - 2011-05-19 22:06 +0000
    Re: word size and gcc builtins usage Keith Thompson <kst-u@mib.org> - 2011-05-19 15:52 -0700
      Re: word size and gcc builtins usage Seebs <usenet-nospam@seebs.net> - 2011-05-19 23:38 +0000
  Re: word size and gcc builtins usage Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-05-19 22:30 -0400
    Re: word size and gcc builtins usage "dr.oktopus" <blindwilly@freeonline.zzn.com> - 2011-05-19 22:31 -0700

csiph-web