Article View: comp.lang.c
Article #1319Re: C: a question about scope automatics in C
From: Ross Finlayson
Date: Wed, 04 Nov 2026 00:39
Date: Wed, 04 Nov 2026 00:39
70 lines
5118 bytes
5118 bytes
On 11/03/2026 03:12 PM, Lawrence D’Oliveiro wrote: > On Tue, 3 Nov 2026 09:02:32 -0800, Ross Finlayson wrote: > >> Then, if one of these records has some dozens, scores, or hundreds >> of fields, among textual, numeric, and calendric built-in and >> user-defined types, then each one of these might need a buffer or >> buffers the scratch-pad or working-memory, as the working-memory of >> the conversion & formatting routines, since for example strtok and >> strtok_r and other accounts of the conversion & formatting after the >> accessor/mutator routines of the records their fields in accounts of >> structured programming: are always using temporaries, here >> "automatic temporary arrays", their buffers. > > Basically, a complex, dynamically-allocated data structure with an > intricate collection of components which themselves need dynamic > allocation? Need to deal with errors that might occur during the setup > and usage of such a structure, to ensure that all memory allocated is > properly freed, without the chance of double-frees or memory leaks? > > Been there, done that. I use a technique called “structured > programming” to deal with the whole issue. > > Have a look at this project: > <https://gitlab.com/ldo/a_structured_discipline_of_programming>. The > README gives an introduction to the concept, and the sample code > illustrates it in (I hope) exhaustive detail. > Thanks I read this briefly and it reminds of "defensive programming", that "structured programming" makes me think of struct basically, and user-defined types. The defensive programming is a lot of things, like library-design and zero-trust and sanitizing-inputs and Postel's law and Murphy's law and discipline-through-idiom and things like "no gotos" or usually "no early exits" and for some things like "error modeling & exception modeling", barriers, most usually though type-safety (after algorithm design modeling the happy, edge, and corner cases, and, the error & failure modes). About these ideas about string libraries, or Gompath & Viswath a "portable" model of general-purpose and vector registers and Charmaigne and "character machines", is that "string" the type is overloaded so much and opaque, then for accounts of noms & nyms for names about low-cardinality and high-cardinality languages, about Unicode and locale and regular expressions and parsers and deserializers and serializers and substring-matching and all these kinds of things, so usual. There's perceived a great requirement for "stability of interface", that re-write systems and term-graph-re-write and the like are so available yet opaque to the users, that since the explosion of "little languages" or "domain-specific languages", and those mostly or often not being very stable, vis-a-vis dotfiles everywhere and all these kinds of things, then for systems programming, it's figured that the modern commodity AMD & ARM (AMD/Intel & ARM) i-s-a's aren't going anywhere, and furthermore their accounts of the vector extensions have a common sub-set, compared to GPGPU's and the like which seem to change their interface every six months, then it's figured that things like text-processing and Unicode are ubiquitous and deserve a quite dedicated low-level "portable" systems-programming-compatible approach. Thanks again!
Technical Details
Message-ID:
<doydnTqjUMYm43f3nZ2dnZfqnPSdnZ2d@giganews.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nrbbs.org!border-3.nntp.ord.giganews.com!nntp.giganews.com!local-3.nntp.ord.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mailReferences:
<oOScndMmgZhYRXX3nZ2dnZfqnPGdnZ2d@giganews.com> <11cce4h$3m11i$1@dont-email.me> <8V2dnW6M3YIeZ3T3nZ2dnZfqn_SdnZ2d@giganews.com> <11cd0tn$3tbkg$1@dont-email.me> <mdicnZHlMZlPlXf3nZ2dnZfqnPednZ2d@giganews.com> <11cd22m$3tpfp$2@dont-email.me> <x8adnYBW_KQgjnf3nZ2dnZfqn_adnZ2d@giganews.com> <11cdpo3$7e97$3@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nrbbs.org!border-3.nntp.ord.giganews.com!nntp.giganews.com!local-3.nntp.ord.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 04 Nov 2026 00:39:23 +0000 Subject: Re: C: a question about scope automatics in C Newsgroups: comp.lang.c References: <oOScndMmgZhYRXX3nZ2dnZfqnPGdnZ2d@giganews.com> <11cce4h$3m11i$1@dont-email.me> <8V2dnW6M3YIeZ3T3nZ2dnZfqn_SdnZ2d@giganews.com> <11cd0tn$3tbkg$1@dont-email.me> <mdicnZHlMZlPlXf3nZ2dnZfqnPednZ2d@giganews.com> <11cd22m$3tpfp$2@dont-email.me> <x8adnYBW_KQgjnf3nZ2dnZfqn_adnZ2d@giganews.com> <11cdpo3$7e97$3@dont-email.me> From: Ross Finlayson <ross.a.finlayson@gmail.com> Date: Tue, 3 Nov 2026 16:39:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <11cdpo3$7e97$3@dont-email.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <doydnTqjUMYm43f3nZ2dnZfqnPSdnZ2d@giganews.com> Lines: 70 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-TTl5X3Fv9Rjgs6I9c1DP2ZvaB8WII0y1QDqo1cZPq+8NWz36EhHzj4AnKhNvzkLpJK6K0viw5Hlk3OC!esF4au9iOYIKDX4x9TnbZo89d/TiBeBeUXDMmc9mJXjtD85cwqDiRQykbNKiKOqeUj8ivvrsVg0= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40