Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Sort char array Date: Sat, 19 Oct 2019 06:04:30 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: <86r238hoo1.fsf@linuxsc.com> References: <20191008022725.36fbd95aa45ba185290e5e11@gmail.com> <1q_mF.841756$Zy3.585129@fx33.am4> <20191009020207.b533aa1c6d95f44eb314ffc1@gmail.com> <5alnF.1041354$WI2.353384@fx34.am4> <20191010003208.ff29e87d2de1e17c50f96c74@gmail.com> <20191013213743.84c68aaf89bc1cd6b995db5b@gmail.com> <20191014005637.56bd13f20bceb6f3c4233b09@gmail.com> <20191014133326.cc63c82d5be1aad83f49d6ff@g{oogle}mail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="3a1975e3f550932398983d5ed513e7ac"; logging-data="21441"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T8tx+UhUJtPa85GFC8Osr/SV2J4ylG5o=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:eMqtn6HqT/ywTGGpS5unY6mffo4= sha1:wQzkZEo+oyEsbjqXlTcyuKyuxvU= Xref: csiph.com comp.lang.c:147074 Malcolm McLean writes: > On Friday, 18 October 2019 13:56:43 UTC+1, mark....@gmail.com wrote: > >> On Friday, 18 October 2019 10:57:40 UTC+1, Bart wrote: >> >>> ... Here is the C equivalent of a bug >>> I found today: >>> >>> char *dataptr; >>> int *p; >>> >>> p = (int*)dataptr; >>> *p = x; >>> dataptr += 4; >> >> dataptr += sizeof(int); // fixed and future-proof >> >> Which is how it should have been coded in the first place. >> >> I'm not sure what your point is. > > Not necessarily, no. This comes down to Tim Rentsch's point about > data and representation. No, it doesn't. Please don't speak for me. You didn't understand the point I was making before, and obviously you still don't.