Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #379468
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Inconsistent... |
| Date | 2023-11-02 20:43 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <875y2jopi2.fsf@bsb.me.uk> (permalink) |
| References | <uhp5jb$kbc1$2@dont-email.me> <87r0lbr7lp.fsf@bsb.me.uk> <uhvp1e$241d2$2@dont-email.me> <87h6m4o52c.fsf@bsb.me.uk> <ui01b3$3jq3j$1@i2pn2.org> |
bart <bc@freeuk.com> writes: > On 02/11/2023 09:52, Ben Bacarisse wrote: >> David Brown <david.brown@hesbynett.no> writes: >> >>> On 31/10/2023 00:52, Ben Bacarisse wrote: >>>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes: >>>> >>>>> This has to be undefined behavior. Check it out: >>>>> >>>>> Here is my C code for a fun toy experimental fractal: >>>>> >>>>> https://pastebin.com/raw/fcV5YiJH >>>>> (raw link to text...) >>>> Ask your compiler for the maximum number of warnings and you should see >>>> lots. For some reason you are mixing types in a peculiar way, and since >>>> some of those types often have different sizes you will get different >>>> arithmetic results on different systems. >>>> >>>>> The cpack is different on the two different compilers. Oh, that is always >>>>> fun! >>>> You need to decide what integer types you really want. >>> >>> And the sane way to do that is to stick strictly to <stdint.h> types, so >>> that the sizes are independent of the compiler and platform. >> Hmm... I would not want to say that exactly. Firstly, it perpetuates >> the misconception that stdint.h only defines the exact-width types >> helping the world to forget about the [u]int_(least|fast)N_t types! > > Is that a bad thing? Yes. > I mean, which other current languages, other than C++, that have > size-specific integer types, also have a set of 'least' and 'fast' > versions? > > It doesn't seem to [be] something that the creators of other languages > lose sleep over. They don't seem to, no. I wonder if the fact that C remains one of the most widely used programming languages is in any way related to that. > Those types appear to be relevant only to unusual architectures that only C > bothers with. > >> Secondly, lots of algorithms can be written perfectly well using C's >> ordinary types. The key is to know what the type names mean. > > Not this one. I am 100% sure that you don't know that to be the case. Why? Because I am 100% sure that not even Chris knows what the actual algorithm is. You may be right, and if anyone ever specifies the algorithm we may even be able to determine the facts of the matter, but we can't do so now. -- Ben.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-30 14:01 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-30 14:11 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-30 14:30 -0700
Re: Inconsistent... Richard Harnden <richard.nospam@gmail.invalid> - 2023-10-30 22:01 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-30 15:09 -0700
Re: Inconsistent... bart <bc@freeuk.com> - 2023-10-30 23:22 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-10-30 23:44 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-10-31 02:05 +0000
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-31 11:32 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-10-31 14:16 +0000
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-31 16:15 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-10-31 18:35 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-31 14:05 -0700
Re: Inconsistent... bart <bc@freeuk.com> - 2023-10-31 22:29 +0000
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 00:39 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-11-01 10:35 +0000
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 13:29 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 12:52 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 14:30 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-31 13:37 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 00:44 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-31 20:26 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 11:05 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-11-01 10:59 +0000
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-01 13:01 +0100
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 13:52 +0000
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-01 20:12 +0100
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 12:52 -0700
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-02 10:04 +0100
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-02 10:51 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-02 11:02 -0700
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-02 20:02 +0100
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-02 12:03 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 23:57 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 00:11 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-02 20:28 +0000
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-03 10:23 +0100
[OT] Encryption (Was: Inconsistent...) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-03 10:10 +0000
Re: [OT] Encryption (Was: Inconsistent...) David Brown <david.brown@hesbynett.no> - 2023-11-03 15:01 +0100
Re: [OT] Encryption (Was: Inconsistent...) scott@slp53.sl.home (Scott Lurndal) - 2023-11-03 16:52 +0000
Re: [OT] Encryption (Was: Inconsistent...) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:12 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:11 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 13:43 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 12:53 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 20:08 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 13:12 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 21:12 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 14:16 -0700
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 21:43 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 16:02 -0700
Re: Inconsistent... bart <bc@freeuk.com> - 2023-11-01 22:59 +0000
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-30 23:52 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-31 13:45 -0700
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-31 14:29 -0700
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-02 10:10 +0100
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-02 09:52 +0000
Re: Inconsistent... bart <bc@freeuk.com> - 2023-11-02 11:31 +0000
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-02 13:52 +0100
Re: Inconsistent... bart <bc@freeuk.com> - 2023-11-02 14:07 +0000
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-02 16:53 +0100
Re: Inconsistent... bart <bc@freeuk.com> - 2023-11-02 19:15 +0000
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-03 10:33 +0100
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-02 20:43 +0000
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-02 13:47 -0700
Re: Inconsistent... David Brown <david.brown@hesbynett.no> - 2023-11-02 13:34 +0100
Re: Inconsistent... Richard Harnden <richard.nospam@gmail.invalid> - 2023-11-01 20:32 +0000
Re: Inconsistent... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-01 21:36 +0000
Re: Inconsistent... Richard Harnden <richard.nospam@gmail.invalid> - 2023-11-01 21:54 +0000
Re: Inconsistent... Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-11-09 15:54 -0800
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-09 01:16 -0800
Re: Inconsistent... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-10 21:02 -0800
csiph-web