Sizes of Integer Types

C

Chris Hills

Richard Heathfield said:
Chris Hills said:



I'm not trying to ignore any bigger pictures. But this isn't about
bigger pictures. This is about whether the draft does or does not say
the same thing as the published Standard

No. It is about the validity of a draft compared to a ratified standard.
about whether intN_t types are
optional. If it doesn't, fine, I'll eat humble pie and be glad of it,
because I'll have learned something. But right now it seems to me that
you're reading a different published Standard to the one I paid ANSI
for, back in early 2000.

No Idea. I don't use ANSI standards.
Could you please point out the paragraphs in the standard that alter the
meaning of the one paragraph I quoted?

You look. That is the whole point. The draft is probably the same but
may be not. The standard may have other things added(or removed) which
may affect the words that appear to be the same in both.

If "close enough is good enough" for you then there is no point quoting
to the standard or draft. Certainly no validity in getting pedantic
about it.


No, I didn't. Perhaps you'd care to elaborate by posting the paragraph
number. (I do have the published Standard, of course, so that will be
sufficient.)

You miss the point. The draft has no authority, may be different and
might have other things that affect the paragraphs that are the same.
 
C

Chris Hills

Richard Heathfield said:
Ian Collins said:


You assume correctly. :) In fact, I had no idea that such sites
existed. If you ever come across another one, apply for a preservation
order.

A LOT of places are like that for VERY good reasons.
 
C

Chris Hills

Ian Collins said:
ISO 9000.

Actually anywhere doing high-integrity, mission critical, medical,
aerospace, rail, nuclear, marine, automotive etc etc

Most places I have worked in do this. Referencing the wrong document can
cause fatalities. Once you get into a rigorous method of working there
seems little point in doing anything else.

BTW Richard... I assume you are happy to use the Koran as the Word of
God as many passages are the same as the Bible? Whole paragraphs....
:)
 
C

Chris Hills

Richard Heathfield said:
Ian Collins said:

Oh, *that*. Nah, when the ISO guys came round, we just didn't show them
the contents of our desk drawers. :)

Would ISO be interested in sandwiches and old copies of FHM and Loaded?
:)
 
J

Joachim Schmitz

Richard Heathfield said:
Ian Collins said:

Oh, *that*. Nah, when the ISO guys came round, we just didn't show them
the contents of our desk drawers. :)
And everything that wasn't easy to hide just got a sticker atached, reading
"for reference purposes only".
Some of these stickers even ended up on workmates' foreheads :cool:

Bye, Jojo
 
R

Richard Heathfield

Chris Hills said:

Er, yes. I'm not arguing that the draft is a wholly adequate replacement
to the Standard. I'm arguing that, where they say the same thing, it's
daft to stand on one's high horse and say "that's only a draft, end of
argument". If the draft differs materially from the Standard with
respect to the subject under discussion, okay, it's a fair cop - but as
far as I have been able to discern so far, Kelsey's quote from the
draft could just as easily have come from the final Standard, and so
your objection was spurious.
It is about the validity of a draft compared to a ratified
standard.

Taken as a whole, the draft obviously has no legal force. Nevertheless,
AIUI the C89 draft was the document used by implementors to keep their
development "on track" for the final standard during the lead-up to
ratification. So clearly drafts are - or at least can be - important
and useful documents, even though they are not normative.
No Idea. I don't use ANSI standards.

The document in question is entitled: INTERNATIONAL STANDARD ISO/IEC
9899:1999 (second edition, 1999-12-01). It's an ISO standard. The fact
that I bought it from ANSI is neither here nor there. I can buy a Dell
laptop from PC World. That doesn't stop it being a Dell laptop.
You look.

Okay, I've looked, and I can see no difference. Since you can't see a
difference either, I deduce that there is no noticeable difference. You
can prove my deduction wrong by citing a difference.
That is the whole point. The draft is probably the same but
may be not. The standard may have other things added(or removed) which
may affect the words that appear to be the same in both.

I'm not from Missouri, but you still gots to show me, if you want me to
accept that you're not merely indulging in sophistry.
If "close enough is good enough" for you then there is no point
quoting to the standard or draft.

Exactly the same is good enough.
Certainly no validity in getting pedantic about it.

Then why *are* you getting pedantic about it?

You miss the point. The draft has no authority, may be different and
might have other things that affect the paragraphs that are the same.

*Show* me that it's different (with respect to the subject under
discussion), and I'll gladly eat humble pie.
 
R

Richard Heathfield

Chris Hills said:

BTW Richard... I assume you are happy to use the Koran as the Word of
God as many passages are the same as the Bible? Whole paragraphs....
:)

Where they are word for word the same? Yes, absolutely. What possible
difference could it make, if the words are the same?
 
C

Chris Hills

Richard Heathfield said:
Chris Hills said:


That's what cafeterias are for.


More likely "Dr Dobbs", "Program Now", and ".EXE". Sorry to disappoint
you... :)

Are any of those still published?

I think Exe has gone.
I had some Program Now once but not seen ay for a while
Dr Dobbs? Is that still going?
 
R

Richard Heathfield

Chris Hills said:
Are any of those still published?

Dr Dobbs is still published. The others died a long time ago.
Fortunately, when a print mag returns from main, the output archive is
unaffected.
 
C

Charlie Gordon

Richard Heathfield said:
Chris Hills said:



Where they are word for word the same? Yes, absolutely. What possible
difference could it make, if the words are the same?

If any words are the same, that would be sheer coincidence, they are not
written in the same tongue, nor even in the same script. Translators can
produce similar translations, but these are not the original Word.
 
R

Richard Heathfield

Charlie Gordon said:
If any words are the same, that would be sheer coincidence, they are
not written in the same tongue, nor even in the same script.

Presumably Chris has a passage in mind where they /are/ the same, and is
prepared to give a reference.
 
C

Chris Hills

Charlie Gordon said:
If any words are the same, that would be sheer coincidence, they are not
written in the same tongue, nor even in the same script

So what were the multitude of books in both written in?
Remember the books of the bible come from many sources, times, and
languages. For many centuries there were versions of the bible that had
different books in them. I believe that eve today not all contain the
same books.

I know less about the history of the Koran though some of the books
contain the same stories, fables etc. with the same characters and would
have come from the same sources..
. Translators can
produce similar translations, but these are not the original Word.

This was a problem with the dead sea scrolls. Actually it is the
problem for most of the Bible. However if two translators take a text
as dictated by the GAOU to the scribe and both translate it slightly
differently which one is the authentic Word of God? .

BTW I am discussing the translation by mere mortals not disputing the
faith or Word of God. Though the Koran, being the later of the two does
pass comment on this.
 
C

Chris Hills

Richard Heathfield said:
Charlie Gordon said:


Presumably Chris has a passage in mind where they /are/ the same, and is
prepared to give a reference.
Not to hand but I have in the past when studying the texts found the
same stories... The events and people are the same but the words are
slightly different. Which you would expect since both are translations
and both are AFAIK are more than one translation from the original

If you are interested in the similarities I will dig some out for you,

Also remember that the Old testament is common to the Jews as well.
Should the Jewish book be given priory as it has had fewer translations
and therefore presumably more correct?

There has been a LOT of controversy over the translations of the bible.
Usually done by a Church that was highly political at the time

BTW Please note I am discussing the translations made by mortals (most
with a political axe to grind) NOT disputing anyone's faith or
disparaging the Word of God.
 
J

Joachim Schmitz

Chris Hills said:
Not to hand but I have in the past when studying the texts found the same
stories... The events and people are the same but the words are slightly
different. Which you would expect since both are translations and both are
AFAIK are more than one translation from the original

If you are interested in the similarities I will dig some out for you,

Also remember that the Old testament is common to the Jews as well. Should
the Jewish book be given priory as it has had fewer translations and
therefore presumably more correct?
Hmm I somehow fail to see how some similaries between Thora, Bible and Koran
are reletad to the equality in (parts of) C standard and -draft.

Hold on: the Buible differs from the Thora by a TC, called the New
Testament...
Or maybe it's more like C89 vs. C99?

Bye, Jojo
 
R

Richard Heathfield

Chris Hills said:
Richard Heathfield writes
Not to hand

Well, when you find one, let me know.
but I have in the past when studying the texts found the
same stories... The events and people are the same but the words are
slightly different.

Then they're not the same words, are they? So (to get back to the
subject of discussion) it's not a good analogy for the draft of C99 and
the final Standard, where (in the case in point) the words /are/ the
same.

<snip>
 
J

Joachim Schmitz

Richard Heathfield said:
Chris Hills said:

Well, when you find one, let me know.


Then they're not the same words, are they? So (to get back to the
subject of discussion) it's not a good analogy for the draft of C99 and
the final Standard, where (in the case in point) the words /are/ the
same.
The more I think about it, the more I like the picture: Thora -> C89,
Bible -> C99, the difference between katholic and protestants would be a TC
(Martin Luther 95 theses), similar for anglicans (or would they be Visual
C?), and the Koran would be C++...

Bye, Jojo
 
C

Chris Hills

Joachim Schmitz said:
The more I think about it, the more I like the picture: Thora -> C89,
Bible -> C99, the difference between katholic and protestants would be a TC
(Martin Luther 95 theses), similar for anglicans (or would they be Visual
C?), and the Koran would be C++...

We had better stop before the The One True Faith of Forth joins in :)
 
K

Kelsey Bjarnason

[snips]

Do you REALLY find so hard to understand that some code does not have to
be portable to every system?

Do you REALLY find it so hard to understand that if you're writing code
where you _know_ the sizes involved on the implementation, you don't
_need_ the uint16_t crap in the first place, as people have been writing
this sort of code for 30 years and more without the new types?

Do you REALLY find it so hard to understand that these types offer no real
benefit in this case, and _cannot_ be relied on in pretty much any other
case, rendering them completely worthless?
 
K

Kelsey Bjarnason

[snips]

You seem determined to ignore arguments against you here. Your chess code
probably wouldn't benefit from int16_t and co

Of course they would. If a 16-bit type were available, even if it meant
sometimes being emulated, then as the developer I have the choice between
the reduced complexity and storage requirements on the one hand, versus
the possibly reduced efficiency on the other. This would be useful.

Instead, I'm left with something which, if used, merrily causes my code to
be uncompileable unless implementation X happens to fit whatever arcane
combination of types I've used.

If I use the new types, portability goes from "virtually all conforming
implementations" down to "Who the hell knows, but it ain't anywhere near
all of 'em."

This is not a step forward.
, and *nobody is suggesting
you should use them for this*.

I am. They'd be perfect for it - if you could rely on them. You can't.
int16_t is not useful when you only want
something at least 16 bits wide. It's only useful in that relatively
minor case where you want an exact-width type.

Which is exactly what the doctor ordered. Got one? Nope, sorry, doesn't
exist on compiler X, Y or Z.
In such a case, you have already said you're happy with masking and
guaranteeing portability to all implmentations.

Not quite. I'd be happiest if I could rely on, say, int16_t, as this
would make the code cleaner, simpler, more maintainable. Can I rely on
those things? Nope. Second choice is to ignore 'em and write the code to
do the job as portably as possible, using existing types and masking, etc,
where necessary.

This has the downside that the code may require more storage than in the
other case, and may require more overhead just in masking and the like,
but if it is a tradeoff between code that works and code that doesn't,
code that works wins every time.

Hmm. How do I get code that works? By avoiding the new int types
nonsense, as they're so fundamentally broken they aren't even required to
*exist*.
(One example I can think of for an exact-width type is a DSP application
where the wrap-around arithmetic of 2's complement is exactly what you
want. You can achieve the same result using x %= 2^32 and if(x>=2^31)
x-= 2^32, but if you know you won't ever need that, why bother?)

Exactly my point; if you could _rely_ on the new int types, they'd make
many thing simpler and clearer. You can't, though, because they're so
badly broken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top