Re: Sizes of Integer Types



Richard Heathfield wrote, On 14/09/07 01:32:
Flash Gordon said:

<snip>
I have not been following who thinks what as carefully as I might.

It shouldn't actually matter, should it?

It saves accusing people of thinking something that they don't think sometimes :-)

There is a tendency on Usenet (and, I think, in life in general) to divide the world into teams, such that if I agree with X about Y, then it is assumed by (some) others that all of my opinions about Y are the same as X's opinions about Y. But this is simply not the case, and there is no reason why it should be.

I often deal with people where I agree with them on some things but not on others.

I agree with Kelsey that intN_t types are completely and utterly useless (wait, wait!).

Well, there I disagree, as I'm sure you noticed. However, as shown below you are being civilised about it and accepting that others may have good reasons.

I also agree with Kelsey that it's no big deal quoting from a draft in clc.

As do I. Especially the port C99 drafts which are effectively the current standard because they are the published standard with the TCs applied. So modulo errors in implementing the TCs they should accurately represent the current standard.

But I am less bullish than Kelsey about other people using intN_t. Personally, I think it's a mistake to be led down that path, but hey, maybe - just *maybe* - there's a real use for these little critters that I haven't thought of, yeah? And some people whose opinion I respect have suggested that they do in fact find these types useful. So, even though they seem completely useless *to me*, and even though I think they are ugly and unnecessary warts, I'm not about to insist that they're dropped from the language. If they are useful to my friends, let them stay, warts and all.

A perfectly reasonable attitude. Actually, I would be happy if the signed versions did not mandate two's complement.

Fixed width types are, IMHO, the perfect types for memory mapped HW. Since then the HW defines it being N bits wide. I was doing this before I was on this group and learned the correct way of doing lots of things, so the code was not as portable as I could easily make it now, but doing anything other than relying on a 16 bit integer type would have been a step too far in terms of the work required to implement the system. It *could* be done, but the extra effort would not be justified by the benefit.

I also see them as useful (but not as important) for interfaces which will be writing binary data and the specification says the data will be exactly N bits wide (the routine actually doing the read/write still has to handle endianness, obviously.

I can also see why a lot of people would find absolutely no use for fixed width types.

I also think that for many uses the fast types could be even better. IMHO a lot of the time one wants a type with a minimum range but wants it as fast as possible. So if you want a minimum of 32 bits and as fast as possible long is not really expressing your requirements since it *could* be 64 bits on a 32 bit architecture.
--
Flash Gordon
.



Relevant Pages

  • Re: kids and their furniture?
    ... I would always honor and respect any house rules I was ... standards that differed significantly from the range of behaviors ... I think it's pretty close to the legal 'reasonable person' standard. ... too much work to reason one's way through every single ...
    (misc.kids)
  • Re: I dont get how the computer arrives at 2^31
    ... > Standard isn't always as careful with the language it uses. ... something that will make its functionality "equivalent" to fprintf(). ... function that created the va_list value passed to vfprintf(). ... The reason is that, unless ...
    (comp.std.c)
  • Re: How do you imagine future Common Lisp standard ?
    ... Scheme doesn't focus on good macro ... Goodness and Badness must be evaluated in a particular design-space ... It's fortunate that this can be done without change to the standard, ... There's no reason to define the old language away, ...
    (comp.lang.lisp)
  • Re: Raw food for pets?
    ... When you say something, and people read it, they are likely to form opinions, make assessments, or even simply question when someone comes up with something so incredibly hypocritical. ... Can't imagine why their posts would have been of any interest to you either, ... Yes, for some reason or reasons still unknown to me, ... I do tend to warn people about her dangerous advice, when she has actually *given* dangerous advice, though I doubt that would have come up with you since she wasn't giving you advice. ...
    (rec.pets.dogs.health)
  • Re: Understanding # and function variables
    ... That's the reason for my statement that I don't care whether a ... >>change is standard compliant or not. ... >>substantial revision of ANSI Common Lisp and would provide equally ... I will find out about an already existing language that is strictly ...
    (comp.lang.lisp)