[cfe-commits] [Review] Rolling out ASTContext::getTypeSizeInChars()
Ted Kremenek
kremenek at apple.com
Tue Jan 12 08:34:10 PST 2010
On Jan 12, 2010, at 5:02 AM, Ken Dyck wrote:
> Just to get the terminology straight here, when we are talking about
> bytes do we mean:
>
> A. an 8-bit value,
> B. the smallest addressable unit of memory on a machine, or
> C. an addressable unit of data storage large enough to hold any member
> of the basic character set of the execution environment (C99), or
> D. something else?
>
> However we define byte it seems that it is at least theoretically
> possible for the character type to have a different width, and so I
> think Ted makes a valid point. If there is code that expects a size in
> bytes (however defined), perhaps we need to add another API.
>
> As a clang newbie, it is difficult to determine whether a literal 8
> means the width of a byte or that of a character, so I'm relying on you
> guys for reviews. So far, I have been approaching the problem with
> definition C above and the simpifying assumption that clang enforces
> byte width == char width, even if neither are 8. This allows characters
> and bytes to be used interchangably.
I'm thinking of B, but I'm also thinking of the unit reported by the 'sizeof()' operator.
More information about the cfe-commits
mailing list