Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The unrecognized minister of propaganda, E -- seen in an email from Ean Schuessler


devel / comp.lang.c / Re: #include <stdint.h>

SubjectAuthor
* #include <stdint.h>SIMON
+* Re: #include <stdint.h>Bart
|`* Re: #include <stdint.h>Bart
| `* Re: #include <stdint.h>Philipp Klaus Krause
|  +* Re: #include <stdint.h>Keith Thompson
|  |`- Re: #include <stdint.h>Philipp Klaus Krause
|  `- Re: #include <stdint.h>Bart
+- Re: #include <stdint.h>James Kuyper
+- Re: #include <stdint.h>Ben Bacarisse
`* Re: #include <stdint.h>Keith Thompson
 +* Re: #include <stdint.h>Philipp Klaus Krause
 |`* Re: #include <stdint.h>Keith Thompson
 | `- Re: #include <stdint.h>Philipp Klaus Krause
 `* Re: #include <stdint.h>Tim Rentsch
  +* Re: #include <stdint.h>Keith Thompson
  |+* Re: #include <stdint.h>Tim Rentsch
  ||`* Re: #include <stdint.h>Keith Thompson
  || `* Re: #include <stdint.h>Tim Rentsch
  ||  `* Re: #include <stdint.h>Keith Thompson
  ||   `* Re: #include <stdint.h>Tim Rentsch
  ||    `* Re: #include <stdint.h>Keith Thompson
  ||     `* Re: #include <stdint.h>Tim Rentsch
  ||      +- Re: #include <stdint.h>Keith Thompson
  ||      `- Re: #include <stdint.h>James Kuyper
  |`* Re: #include <stdint.h>Andrey Tarasevich
  | +- Re: #include <stdint.h>Keith Thompson
  | `* Re: #include <stdint.h>James Kuyper
  |  `* Re: #include <stdint.h>Branimir Maksimovic
  |   `* Re: #include <stdint.h>James Kuyper
  |    `- Re: #include <stdint.h>Branimir Maksimovic
  `* Re: #include <stdint.h>Ben Bacarisse
   +* Re: #include <stdint.h>Öö Tiib
   |`- Re: #include <stdint.h>Keith Thompson
   `- Re: #include <stdint.h>Tim Rentsch

Pages:12
Re: #include <stdint.h>

<86zgrmqv6h.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18581&group=comp.lang.c#18581

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 06 Oct 2021 03:55:34 -0700
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <86zgrmqv6h.fsf@linuxsc.com>
References: <sa5vrs$7d3$1@dont-email.me> <87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com> <874kdnw20s.fsf@nosuchdomain.example.com> <86sg0l6uza.fsf@linuxsc.com> <87mtqs5vre.fsf@nosuchdomain.example.com> <86h7gu7dki.fsf@linuxsc.com> <87a6mm2gzj.fsf@nosuchdomain.example.com> <86h7e2tawh.fsf@linuxsc.com> <87h7e2hxy3.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="f63a7b6827eb8960d7c84af554cfeab9";
logging-data="28167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vqXQl5uwOTh3WsGpRy7bvKTjsiPQg8l8="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Gipwtrys5mZ14/MIGJkoPuo9NFs=
sha1:fjzwm+6ylketEYoNBeQGy+SebZ4=
 by: Tim Rentsch - Wed, 6 Oct 2021 10:55 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
> [...]
>
>>> I think it's not so much misunderstanding as disagreement.
>>>
>>> You wrote:
>>>
>>> Whether the C standard "actually says" that the va_arg rules apply
>>> to *printf functions is, I think, not an answerable question, and in
>>> any case not really a useful question for purposes of comp.lang.c.
>>>
>>> I simply disagree. It is an answerable question, [...]
>>
>> The question I am considering does not have an objective answer.
>> Did you not understand that?
>
> I understood what you said. I think you're wrong. Did you not
> understand that?

I understood your statement. But I don't know what proposition
it is that you think is wrong. Please note what I said: the
question I am considering does not have an objective answer. Are
you assuming that the question I am considering is the same as
the question you are considering? My statement is about the
question I am considering, not about the question you are
considering. At this point it seems apparent that they are not
the same question. Do you agree or disagree with that last
sentence?

Re: #include <stdint.h>

<87a6jm8cxp.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18588&group=comp.lang.c#18588

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 06 Oct 2021 07:06:58 -0700
Organization: None to speak of
Lines: 44
Message-ID: <87a6jm8cxp.fsf@nosuchdomain.example.com>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <86sg0l6uza.fsf@linuxsc.com>
<87mtqs5vre.fsf@nosuchdomain.example.com> <86h7gu7dki.fsf@linuxsc.com>
<87a6mm2gzj.fsf@nosuchdomain.example.com> <86h7e2tawh.fsf@linuxsc.com>
<87h7e2hxy3.fsf@nosuchdomain.example.com> <86zgrmqv6h.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="fa80d595787fe04fe31c20e786e6f9a8";
logging-data="15934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bx2zdhlf0uueHA2AeSyc4"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:nHjrYXrGv7yhwQ0xZT8dPEusmJ4=
sha1:X/WQcoGxBXq25j3s10j16M/gSxE=
 by: Keith Thompson - Wed, 6 Oct 2021 14:06 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>> [...]
>>
>>>> I think it's not so much misunderstanding as disagreement.
>>>>
>>>> You wrote:
>>>>
>>>> Whether the C standard "actually says" that the va_arg rules apply
>>>> to *printf functions is, I think, not an answerable question, and in
>>>> any case not really a useful question for purposes of comp.lang.c.
>>>>
>>>> I simply disagree. It is an answerable question, [...]
>>>
>>> The question I am considering does not have an objective answer.
>>> Did you not understand that?
>>
>> I understood what you said. I think you're wrong. Did you not
>> understand that?
>
> I understood your statement. But I don't know what proposition
> it is that you think is wrong. Please note what I said: the
> question I am considering does not have an objective answer. Are
> you assuming that the question I am considering is the same as
> the question you are considering? My statement is about the
> question I am considering, not about the question you are
> considering. At this point it seems apparent that they are not
> the same question. Do you agree or disagree with that last
> sentence?

You're resurrecting a discussion from several months ago. I'm not
sufficiently interested to go back and refresh my memory of what
we were talking about. History does not suggest that we would reach a
meaningful conclusion.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: #include <stdint.h>

<sjkges$pf4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18590&group=comp.lang.c#18590

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 6 Oct 2021 11:47:38 -0400
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <sjkges$pf4$1@dont-email.me>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <86sg0l6uza.fsf@linuxsc.com>
<87mtqs5vre.fsf@nosuchdomain.example.com> <86h7gu7dki.fsf@linuxsc.com>
<87a6mm2gzj.fsf@nosuchdomain.example.com> <86h7e2tawh.fsf@linuxsc.com>
<87h7e2hxy3.fsf@nosuchdomain.example.com> <86zgrmqv6h.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 6 Oct 2021 15:47:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="916eaa11f9b6796f81670f7f912764c2";
logging-data="26084"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eOWImmUw5UrLYLxyXtnJyX/KORpF23oE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:6cDpMzvmOOgnYxhQibJjrkrJEys=
In-Reply-To: <86zgrmqv6h.fsf@linuxsc.com>
Content-Language: en-US
 by: James Kuyper - Wed, 6 Oct 2021 15:47 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>> [...]
>>
>>>> I think it's not so much misunderstanding as disagreement.
>>>>
>>>> You wrote:
>>>>
>>>> Whether the C standard "actually says" that the va_arg rules apply
>>>> to *printf functions is, I think, not an answerable question, and in
>>>> any case not really a useful question for purposes of comp.lang.c.
>>>>
>>>> I simply disagree. It is an answerable question, [...]
>>>
>>> The question I am considering does not have an objective answer.
>>> Did you not understand that?
>>
>> I understood what you said. I think you're wrong. Did you not
>> understand that?
>
> I understood your statement. But I don't know what proposition
> it is that you think is wrong.

He was quite clear about that - your proposition that it is "not an
answerable question". He believes it is an answerable question - he said
so explicitly.

> ... Please note what I said: the
> question I am considering does not have an objective answer.

Precisely - that is the assertion he's clearly disagreeing with.

> ... Are
> you assuming that the question I am considering is the same as
> the question you are considering?

The question of yours that he was talking about is clearly quoted above,
though I'll have to make a few minor changes to turn it into a proper
question:

Does "the C standard actually say that the va_arg rules apply to *printf
functions?".

That is the question that you've asserted is not answerable, and I agree
with Keith both that it is trivially answerable, and that the answer is
clearly "No.".

> ... My statement is about the
> question I am considering, not about the question you are
> considering.

I see no evidence to suggest that Keith is confusing your question about
what the standard says, with your statement about the answerability of
that question. Nor that he was talking about some other question.
Perhaps you are so strongly committed to the idea that it is
unanswerable that you can't imagine anyone disagreeing with you about
that point? He wrote, before the material quoted above:

The clipped the part of his response that said "... and the answer is
no;". The first part of that sentence was about your statement that the
question is unanswerable, and asserted Keith's belief that it is
answerable. The second part is the answer that Keith considers that
question to have. I'm in full agreement with him on both points.

The standard might be taken as implying that only those rules apply. I
would consider that a misinterpretation of the words of the standard,
but it might have been the committee's intent - it's certainly not
unheard of for the committee to fail to correctly express their intent.
However, the standard most definitively fails to say that they apply.

The wording the committee actually chose is subtly different from the
va_arg() rules, without being incompatible with those rules. If they had
simply intended for those rules to apply, and nothing more, it would
have been simpler to cross-reference those rules, rather than copying
those rules, and risking the possibility of the copy being subtly
different from the original. It seems much more plausible to me that
they would do that only if making the rules subtly different was their
whole point in writing it that way.

You have a habit of seeing ambiguity in wording that isn't really
ambiguous, and of using that supposed ambiguity to justify your own best
guess as to what the committee meant, even when that meaning
incompatible with the words they chose to use to express their intent.
And since you sincerely believe the words to be ambiguous, you don't
admit that the are incompatible.

Re: #include <stdint.h>

<sjkj8l$e7e$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18591&group=comp.lang.c#18591

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: andreyta...@hotmail.com (Andrey Tarasevich)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 6 Oct 2021 09:35:31 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <sjkj8l$e7e$1@dont-email.me>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 6 Oct 2021 16:35:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="eff7dbf1fcddb7e8267634a997988dba";
logging-data="14574"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18us1hABmb6XQrQW8qcQCv3"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:Hl+x7n3agsqQZmRiGjhr1YT0Zmk=
In-Reply-To: <874kdnw20s.fsf@nosuchdomain.example.com>
Content-Language: en-US
 by: Andrey Tarasevich - Wed, 6 Oct 2021 16:35 UTC

On 6/24/2021 11:28 AM, Keith Thompson wrote:
>
> My reading of the standard is that that's certainly the intent, but
> it's not quite stated explicitly.
>

Yes, it does. The intent of 6.2.5/9 is, among other things, is to
postulate interchangeability of values of corresponding signed-unsigned
types as function arguments.

No special remarks of any kind are made about variadic functions, which
immediately closes the matter. No need to dig deeper and involve
`va_arg` or anything else.

--
Best regards,
Andrey Tarasevich

Re: #include <stdint.h>

<871r4y84lz.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18592&group=comp.lang.c#18592

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 06 Oct 2021 10:06:48 -0700
Organization: None to speak of
Lines: 40
Message-ID: <871r4y84lz.fsf@nosuchdomain.example.com>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <sjkj8l$e7e$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="fa80d595787fe04fe31c20e786e6f9a8";
logging-data="17342"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dDhiuN/NPDx6POA1d4Pma"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:KjbtHbUhTcCmTUVNmQcbQUo1mPE=
sha1:vRroFopiwne4pBPScvH6ld/368Y=
 by: Keith Thompson - Wed, 6 Oct 2021 17:06 UTC

Andrey Tarasevich <andreytarasevich@hotmail.com> writes:
> On 6/24/2021 11:28 AM, Keith Thompson wrote:
>> My reading of the standard is that that's certainly the intent, but
>> it's not quite stated explicitly.
>
> Yes, it does. The intent of 6.2.5/9 is, among other things, is to
> postulate interchangeability of values of corresponding
> signed-unsigned types as function arguments.
>
> No special remarks of any kind are made about variadic functions,
> which immediately closes the matter. No need to dig deeper and involve
> `va_arg` or anything else.

N1570 6.2.5p9 says that a value that's within the range of corresponding
signed and unsigned types has the same representation in both types.
That doesn't necessarily imply interchangeability as function arguments.

It's only relevant for variadic arguments or if no prototype is visible;
otherwise an argument will be converted to the required type (and the
conversion will correctly yield the same value).

I can imagine an implementation in which signed integer arguments are
passed on the stack and unsigned integer arguments are passed in
registers, or in which they're passed in different registers. That
would violate the stated intent given in the non-normative footnote:

The same representation and alignment requirements are meant to imply
interchangeability as arguments to functions, return values from
functions, and members of unions.

but I see no normative wording in the standard that would be violated by
such an admittedly perverse implementation.

Perhaps my phrase "not quite stated explicitly" was imprecise. It's
stated explicitly in a footnote, but not in normative text.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: #include <stdint.h>

<sjl53p$8us$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18603&group=comp.lang.c#18603

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 6 Oct 2021 17:40:08 -0400
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <sjl53p$8us$1@dont-email.me>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <sjkj8l$e7e$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 6 Oct 2021 21:40:09 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="916eaa11f9b6796f81670f7f912764c2";
logging-data="9180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FiNstS4PDFAra8/wvW6T1vihS7HlWDYo="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:bvd2kc0TG8+50n8kUkUiTfoCgwQ=
In-Reply-To: <sjkj8l$e7e$1@dont-email.me>
Content-Language: en-US
 by: James Kuyper - Wed, 6 Oct 2021 21:40 UTC

On 10/6/21 12:35 PM, Andrey Tarasevich wrote:
> On 6/24/2021 11:28 AM, Keith Thompson wrote:
>>
>> My reading of the standard is that that's certainly the intent, but
>> it's not quite stated explicitly.
>>
>
> Yes, it does. The intent of 6.2.5/9 is, among other things, is to
> postulate interchangeability of values of corresponding signed-unsigned
> types as function arguments.

In several locations, the standard says "The same representation and
alignment requirements are meant to imply interchangeability as
arguments to functions, return values from functions, and members of
unions."

There's several problems with that statement. Firstly, "are meant to
imply" is weasel-wording. It could have said, more simply and
forcefully, "implies". Secondly, the implication doesn't hold up under
close examination. For instance, unsigned and signed arguments with the
same alignment and same representation for positive values of the signed
type could still be passed by different methods as arguments or return
values, which would prevent them from being interchangeable. Finally,
that wording only appears in informative footnotes, not in normative text.

After raising this issue many times over a couple of decades, I finally
got confirmation from Larry Jones in 2011 (at that time, secretary of
the committee) that use of "are meant to imply" rather than "implies"
was deliberate, because it was in fact understood that no such
implication was correct. He also confirmed that the non-normative nature
of that text was also deliberate - the committee did NOT want to mandate
that the types be interchangeable, only to recommend that they be made
interchangeable.

> No special remarks of any kind are made about variadic functions, which
> immediately closes the matter. No need to dig deeper and involve
> `va_arg` or anything else.

In C2011, the descriptions of the printf() and scanf() family of
functions contained one notable difference from the corresponding
general requirements for functions with variable arguments: "If any
argument is not the correct type for the corresponding conversion
specification, the behavior is undefined.".

An implementation of C2011 could therefore have provided a conforming
extension to the <va_args.h> facilities, allowing you to determine the
type of the argument corresponding to each parameter,and the
implementations of those functions could make use of that information to
fail in some fashion when the argument's type is not correct. Such an
implementation would not violate any requirement of C2011.

In n2596.pdf, the latest draft of the next version that I have access
to, that wording has been replaced:
"fprintf shall behave as if it uses va_arg with a type argument naming
the type resulting from applying the default argument promotions to the
type corresponding to the conversion specification and then converting
the result of the va_arg expansion to the type corresponding to the
conversion specification."

This indicates that the committee acknowledges the validity of that
complaint, and has resolved it in a way that's not compatible with the
hypothetical implementation I've described above.

Re: #include <stdint.h>

<%cp7J.10367$yk1.4260@fx13.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18604&group=comp.lang.c#18604

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mail
Newsgroups: comp.lang.c
From: branimir...@icloud.com (Branimir Maksimovic)
Subject: Re: #include <stdint.h>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <sjkj8l$e7e$1@dont-email.me>
<sjl53p$8us$1@dont-email.me>
User-Agent: slrn/1.0.3 (Darwin)
Lines: 76
Message-ID: <%cp7J.10367$yk1.4260@fx13.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Wed, 06 Oct 2021 22:14:19 UTC
Organization: usenet-news.net
Date: Wed, 06 Oct 2021 22:14:19 GMT
X-Received-Bytes: 4462
 by: Branimir Maksimovic - Wed, 6 Oct 2021 22:14 UTC

On 2021-10-06, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
> On 10/6/21 12:35 PM, Andrey Tarasevich wrote:
>> On 6/24/2021 11:28 AM, Keith Thompson wrote:
>>>
>>>
>>
>> Yes, it does. The intent of 6.2.5/9 is, among other things, is to
>> postulate interchangeability of values of corresponding signed-unsigned
>> types as function arguments.
>
>
> In several locations, the standard says "The same representation and
> alignment requirements are meant to imply interchangeability as
> arguments to functions, return values from functions, and members of
> unions."
>
> There's several problems with that statement. Firstly, "are meant to
> imply" is weasel-wording. It could have said, more simply and
> forcefully, "implies". Secondly, the implication doesn't hold up under
> close examination. For instance, unsigned and signed arguments with the
> same alignment and same representation for positive values of the signed
> type could still be passed by different methods as arguments or return
> values, which would prevent them from being interchangeable. Finally,
> that wording only appears in informative footnotes, not in normative text.
>
> After raising this issue many times over a couple of decades, I finally
> got confirmation from Larry Jones in 2011 (at that time, secretary of
> the committee) that use of "are meant to imply" rather than "implies"
> was deliberate, because it was in fact understood that no such
> implication was correct. He also confirmed that the non-normative nature
> of that text was also deliberate - the committee did NOT want to mandate
> that the types be interchangeable, only to recommend that they be made
> interchangeable.

Problem is that C does not defines exact type and representation.
New language have noted that mistake so they have exact representation,
even if that not corresponds to hardware.
C goed in a way to have performance and portability, which of course
you can't have both, you just have buggy programs :p
>
>> No special remarks of any kind are made about variadic functions, which
>> immediately closes the matter. No need to dig deeper and involve
>> `va_arg` or anything else.
>
> In C2011, the descriptions of the printf() and scanf() family of
> functions contained one notable difference from the corresponding
> general requirements for functions with variable arguments: "If any
> argument is not the correct type for the corresponding conversion
> specification, the behavior is undefined.".
>
> An implementation of C2011 could therefore have provided a conforming
> extension to the <va_args.h> facilities, allowing you to determine the
> type of the argument corresponding to each parameter,and the
> implementations of those functions could make use of that information to
> fail in some fashion when the argument's type is not correct. Such an
> implementation would not violate any requirement of C2011.
>
> In n2596.pdf, the latest draft of the next version that I have access
> to, that wording has been replaced:
> "fprintf shall behave as if it uses va_arg with a type argument naming
> the type resulting from applying the default argument promotions to the
> type corresponding to the conversion specification and then converting
> the result of the va_arg expansion to the type corresponding to the
> conversion specification."
>
> This indicates that the committee acknowledges the validity of that
> complaint, and has resolved it in a way that's not compatible with the
> hypothetical implementation I've described above.

--

7-77-777
Evil Sinner!
to weak you should be meek, and you should brainfuck stronger
https://github.com/rofl0r/chaos-pp

Re: #include <stdint.h>

<sjldm8$ne4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18605&group=comp.lang.c#18605

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: #include <stdint.h>
Date: Wed, 6 Oct 2021 20:06:31 -0400
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <sjldm8$ne4$1@dont-email.me>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <sjkj8l$e7e$1@dont-email.me>
<sjl53p$8us$1@dont-email.me> <%cp7J.10367$yk1.4260@fx13.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 7 Oct 2021 00:06:32 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="15ce51ebe19b9d60d06a1e75f3e399e4";
logging-data="24004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DQDSI84LDVYv7ICPdYdNtslzzrEKHmrQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:D7lKXTMXYBLYDbYsOc1/XQW/Bac=
In-Reply-To: <%cp7J.10367$yk1.4260@fx13.iad>
Content-Language: en-US
 by: James Kuyper - Thu, 7 Oct 2021 00:06 UTC

On 10/6/21 6:14 PM, Branimir Maksimovic wrote:
> On 2021-10-06, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
....
>> In several locations, the standard says "The same representation and
>> alignment requirements are meant to imply interchangeability as
>> arguments to functions, return values from functions, and members of
>> unions."
>>
>> There's several problems with that statement. Firstly, "are meant to
>> imply" is weasel-wording. It could have said, more simply and
>> forcefully, "implies". Secondly, the implication doesn't hold up under
>> close examination. For instance, unsigned and signed arguments with the
>> same alignment and same representation for positive values of the signed
>> type could still be passed by different methods as arguments or return
>> values, which would prevent them from being interchangeable. Finally,
>> that wording only appears in informative footnotes, not in normative text.
>>
>> After raising this issue many times over a couple of decades, I finally
>> got confirmation from Larry Jones in 2011 (at that time, secretary of
>> the committee) that use of "are meant to imply" rather than "implies"
>> was deliberate, because it was in fact understood that no such
>> implication was correct. He also confirmed that the non-normative nature
>> of that text was also deliberate - the committee did NOT want to mandate
>> that the types be interchangeable, only to recommend that they be made
>> interchangeable.
>
> Problem is that C does not defines exact type and representation.
> New language have noted that mistake so they have exact representation,
> even if that not corresponds to hardware.
> C goed in a way to have performance and portability, which of course
> you can't have both, you just have buggy programs :p

No, that's a distinct issue. If the C standard were changed to
explicitly specify the exact representation of every data type, and no
other changes were made, it would still be perfectly legal, for
instance, for an implementation to use different methods for passing
signed and unsigned arguments; on an implementation that did so, they
would not be interchangeable as arguments of or return values from
functions, not even for values that are representable in both types.

It's also not necessarily a problem with C. Different languages are
designed for different purposes. C was designed to be efficiently
implementable almost everywhere - at the cost of making it more
difficult to port code from one implementation to another. Other
languages consider it more important to be able to port code between any
two implementations of the language, at the cost of the language not
being efficiently implementable on all platforms.
C has added the size-named integer types, which mitigates this problem
somewhat.

Re: #include <stdint.h>

<bLs7J.43795$tA2.28443@fx02.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18606&group=comp.lang.c#18606

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx02.iad.POSTED!not-for-mail
Newsgroups: comp.lang.c
From: branimir...@icloud.com (Branimir Maksimovic)
Subject: Re: #include <stdint.h>
References: <sa5vrs$7d3$1@dont-email.me>
<87wnqxxoe3.fsf@nosuchdomain.example.com> <86bl7vb24m.fsf@linuxsc.com>
<874kdnw20s.fsf@nosuchdomain.example.com> <sjkj8l$e7e$1@dont-email.me>
<sjl53p$8us$1@dont-email.me> <%cp7J.10367$yk1.4260@fx13.iad>
<sjldm8$ne4$1@dont-email.me>
User-Agent: slrn/1.0.3 (Darwin)
Lines: 11
Message-ID: <bLs7J.43795$tA2.28443@fx02.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Thu, 07 Oct 2021 02:15:35 UTC
Organization: usenet-news.net
Date: Thu, 07 Oct 2021 02:15:35 GMT
X-Received-Bytes: 1094
 by: Branimir Maksimovic - Thu, 7 Oct 2021 02:15 UTC

On 2021-10-07, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
> C has added the size-named integer types, which mitigates this problem
> somewhat.
I see. Thanks.

--

7-77-777
Evil Sinner!
to weak you should be meek, and you should brainfuck stronger
https://github.com/rofl0r/chaos-pp

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor