Re: advantage of using typedefs



On Sat, 28 Jan 2006 21:31:09 GMT, in comp.lang.c , Keith Thompson
<kst-u@xxxxxxx> wrote:

>
>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.

>but I don't see what you're
>getting at with the first point. If you want the biggest possible
>unsigned integer, its size *will* vary from platform to platform, but
>you presented the variation in size as a reason not to use "unsigned
>long long".

My point was that it will vary, and is thus a nonportable construct in
terms of say file access. If all you care about is one platform, then
no problem.
But this thread was about why one would use typedefs, and one reason
is to keep such platform specific stuff in a single place.
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.



Relevant Pages

  • 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 ... >>you presented the variation in size as a reason not to use "unsigned ...
    (comp.lang.c)
  • Re: Macs in Enterprise
    ... interoperability support into the mix. ... But you could have distinct separate networks, ... There's no reason that has to be a bad thing for the company. ... or expense than the first platform? ...
    (comp.sys.mac.advocacy)
  • Re: import dl on AMD64 platform
    ... It seems that the 'dl' module is not available on that platform. ... only reason I need the 'dl' module, however, is for the values of ... so maybe it doesn't build properly on amd64. ... If that doesn't work then report a bug. ...
    (comp.lang.python)
  • Re: Do Mac owners learn to drive / ride?
    ... I guess the reason I don't 'get it' is because I don't have any issues ... difficult (like with this DSA CD). ... You're trolling again T i m. ... have to run on a platform I could easily maintain and run all the ...
    (uk.comp.sys.mac)
  • Re: Jobs Data due in 45 minutes
    ... > Looking for a 2300 pivot level ... For some reason I was thinking only the trading desk was closed not the ... whole platform during the Fri evening-Sun evening stretch. ... MG shuts down from Fri 1500 to Sun 1700. ...
    (misc.invest.stocks)