Deutsch English Français Italiano |
<87bk29duba.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: relearning C: why does an in-place change to a char* segfault? Date: Sat, 03 Aug 2024 17:07:37 -0700 Organization: None to speak of Lines: 17 Message-ID: <87bk29duba.fsf@nosuchdomain.example.com> References: <IoGcndcJ1Zm83zb7nZ2dnZfqnPWdnZ2d@brightview.co.uk> <20240801114615.906@kylheku.com> <v8gs06$2ceis$1@dont-email.me> <v8jlnk$31hqf$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sun, 04 Aug 2024 02:07:38 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d07bdb3c66a7f25ead61bbbbc164c6d5"; logging-data="3865857"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qbSXpLczepdnxNrCBi6il" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:TJ8gTjj6WGj+e2VSm1eAPncflYw= sha1:0u3cbMrshOmDF1s/D/ANzzDQ83M= Bytes: 1784 David Brown <david.brown@hesbynett.no> writes: [...] > "this is a test" is a string literal, and is typically part of the > program's image. (There are some C implementations that do things > differently, like storing such initialisation data in a compressed > format.) [...] What implementations do that? Typically data that's all zeros isn't stored in the image, but general compression isn't something I've seen (not that I've paid much attention). It would save space in the image, but it would require decompression at load time and wouldn't save any space at run time. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */