Re: advantage of using typedefs



On 2006-01-28, Keith Thompson <kst-u@xxxxxxx> wrote:
> Mark McIntyre <markmcintyre@xxxxxxxxxxx> writes:
>> On Sat, 28 Jan 2006 19:32:56 GMT, in comp.lang.c , Keith Thompson
>> <kst-u@xxxxxxx> wrote:
>>>Mark McIntyre <markmcintyre@xxxxxxxxxxx> writes:
>>>> On 28 Jan 2006 00:50:55 -0800, in comp.lang.c ,
>>>> "junky_fellow@xxxxxxxxxxx" <junky_fellow@xxxxxxxxxxx> wrote:
>>>>
>>>>>I believe unsigned long long should be highest possible integer type ?
>>>>>Or am I wrong ?
>>>>
>>>> You're right, but the size of long long varies from platform to
>>>> platform
>>>
>>>Yes, but if you want the biggest unsigned integer type, you have to
>>>accept that its size is going to vary.
>>
>> ... which was my point.
>
> Then I'm confused. junky_fellow's question was:
>
> But if this is the case (ie we need the biggest possible unsigned
> integer to hold offset ) then why not declare unsigned long long
> offset
>
> and you replied:
>
> Because then its size would vary from platform to platform, and on
> a c90 implementation it would be an error.

Regardless, there's a factual problem. The "offset" (assuming it is
posix off_t) is used in places where it must be negative, and thus
should not be unsigned anything. the original post said long, not
unsigned long.
.



Relevant Pages

  • Re: advantage of using typedefs
    ... >the biggest possible unsigned integer to hold offset) then why not declare ... Because then its size would vary from platform to platform, ... c90 implementation it would be an error. ...
    (comp.lang.c)
  • Re: advantage of using typedefs
    ... > integer to hold offset) then why not declare unsigned long long ... > Because then its size would vary from platform to platform, ... If you want the biggest possible ... But this thread was about why one would use typedefs, and one reason ...
    (comp.lang.c)
  • Re: The OS X satisfaction chart
    ... Just for *me* the graph's Y axis still needs a -40 offset (against XP ... and the PC platform). ... T i m (still day 4 on the chart). ...
    (uk.comp.sys.mac)
  • Re: advantage of using typedefs
    ... consider the offset in a file. ... By creating the typedef, ... This is preferable to searching the source code for all offset ... practical for that platform. ...
    (comp.lang.c)