Re: Pointer arithmetic error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Li wrote:
[...]
> I don't think so. The offset part of the ptr_add op is mean to be the
> absolute offset, not how many element of the pointer index. In other
> words, it is how many address number it need to add.

Hmm. True. But even so, it's still not right on my system, which doesn't
use 8-bit bytes. (It's word addressable where each word can contain any
value, so sizeof(int) == sizeof(double) == sizeof(char) == 1.)

Should there, then, be another symbol to define the number of bits in a
byte, distinct from the number of bits in a char?

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux