Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: relearning C: why does an in-place change to a char* segfault? Date: Thu, 15 Aug 2024 16:00:35 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: <86ikw1o0h8.fsf@linuxsc.com> References: <87jzh0gdru.fsf@nosuchdomain.example.com> <20240801174256.890@kylheku.com> <864j7oszhu.fsf@linuxsc.com> <87o75vg9ot.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 16 Aug 2024 01:00:35 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7281b2582241b74932977c55e2504530"; logging-data="1184676"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19g2EmGBr5iX7qWAYhcbnT8OdD4SlQ5rTQ=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:LmvKIhqTErfib4+ouLKejhIwGfY= sha1:lzCMIdvnus6pq3wyRO6WSCmDeFY= Bytes: 2337 Keith Thompson writes: > Tim Rentsch writes: > >> James Kuyper writes: >> >>> Just as 1 is an integer literal whose value cannot be modified, >>> [...] >> >> The C language doesn't have integer literals. C has string >> literals, and compound literals, and it has integer constants. >> But C does not have integer literals. > > Technically correct (but IMHO not really worth worrying about). Anyone who flogs others posters for incorrectly using terminology defined in the ISO C standard should set a good example by using the ISO-C-defined terms correctly himself. > There is a proposal for C2y, authored by Jens Gustedt, to change the > term "constant" to "literal" for character, integer, and floating > constants. (I think it's a good idea.) > > The more C is changed to resemble C++ the worse it becomes. It isn't surprising that you like it.