Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #123792
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: C needs to evolve |
| Date | 2017-12-03 23:02 -0800 |
| Organization | None to speak of |
| Message-ID | <lnwp23ugap.fsf@kst-u.example.com> (permalink) |
| References | (2 earlier) <QjxUB.105781$W61.83338@fx08.am4> <9be489e6-8c1e-4d5a-83f8-35960e6b28e3@googlegroups.com> <hJJUB.3826$lD5.167@fx39.iad> <p01gp3$2q1$1@dont-email.me> <37613bba-407c-431b-bdd7-d1832da0dd28@googlegroups.com> |
Felipe Ferreira <felipefsdev@gmail.com> writes:
> On Sunday, December 3, 2017 at 1:42:15 AM UTC-3, Keith Thompson wrote:
>> You snipped the part where I asked for specific examples of standard
>> library functions where types defined in <stdint.h> would work better
>> than the types currently used. Do you have such examples?
>
> Like I said, it's about conformance. That's the whole advantage. The
> string library would benefit from that. If you are working with
> networking, you might be working with different architectures and
> knowing that that a int8_t/int16_t/int32_t in one is equal to a
> int8_t/int16_t/int32_t in the other will save a lot of pain knowing
> that the the functions that you used were specific for
> int8_t/int16_t/int32_t and will behave the same in both different
> architectures. You will know that certain data structure will have the
> same size, making sure that sending one through network and
> mem-copying on the other end will work.
How is it about conformance? In a conforming implementation, strlen()
return a result of type size_t, which is the type used to represent
sizes. It might be 16, 32, or 64 bits, or even some other size -- and
it's easy enough to find out which. Exactly what change are you
suggesting?
Data structures are generally *not* binary-compatible across
architectures. That's not just because of size, you also have to
consider alignment and endianness.
> On Saturday, December 2, 2017 at 11:56:21 PM UTC-3, Richard Damon wrote:
[...]
>> int16_t and int32_t might not exist, so really can't be used.
>
> True, but that would be a case of non conformance.
Not at all. The intN_t types are optional (N1570 7.20.1.1p3).
[...].
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Re: C needs to evolve Chris Ahlstrom <OFeem1987@teleworm.us> - 2017-12-02 07:28 -0500
Re: C needs to evolve bartc <bc@freeuk.com> - 2017-12-02 12:50 +0000
Re: C needs to evolve Felipe Ferreira <felipefsdev@gmail.com> - 2017-12-02 06:26 -0800
Re: C needs to evolve "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-12-02 08:31 -0800
Re: C needs to evolve "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-12-02 17:36 +0100
Re: C needs to evolve Keith Thompson <kst-u@mib.org> - 2017-12-02 15:40 -0800
Re: C needs to evolve Felipe Ferreira <felipefsdev@gmail.com> - 2017-12-02 17:40 -0800
Re: C needs to evolve Felipe Ferreira <felipefsdev@gmail.com> - 2017-12-02 17:46 -0800
Re: C needs to evolve Ian Collins <ian-news@hotmail.com> - 2017-12-03 14:53 +1300
Re: C needs to evolve Keith Thompson <kst-u@mib.org> - 2017-12-02 20:42 -0800
Re: C needs to evolve Richard Damon <Richard@Damon-Family.org> - 2017-12-02 21:56 -0500
Re: C needs to evolve David Brown <david.brown@hesbynett.no> - 2017-12-03 19:45 +0100
Re: C needs to evolve Felipe Ferreira <felipefsdev@gmail.com> - 2017-12-03 11:35 -0800
Re: C needs to evolve David Brown <david.brown@hesbynett.no> - 2017-12-03 21:58 +0100
Re: C needs to evolve James Kuyper <jameskuyper@verizon.net> - 2017-12-03 21:01 -0500
Re: C needs to evolve Keith Thompson <kst-u@mib.org> - 2017-12-03 23:02 -0800
Re: C needs to evolve Thiago Adams <thiago.adams@gmail.com> - 2017-12-03 12:39 -0800
Re: C needs to evolve David Brown <david.brown@hesbynett.no> - 2017-12-03 22:07 +0100
Re: C needs to evolve Ian Collins <ian-news@hotmail.com> - 2017-12-03 11:34 +1300
Re: C needs to evolve Melzzzzz <Melzzzzz@zzzzz.com> - 2017-12-03 05:25 +0000
Re: C needs to evolve bartc <bc@freeuk.com> - 2017-12-03 12:37 +0000
csiph-web