|
From: Donal F. <don...@ma...> - 2025-10-20 16:00:42
|
OK, here's the follow up. I've been messing around with C11 for a while and have split out the awful mess that was the c-std-update branch into separate, more closely focused branches. These do not cover the full range of what can be done with C11! In some cases, they don't even cover the full range of what we could with the specific feature. c11-anon-members: Makes some of the nested messes with structs and unions less messy. It's small yet nice. c11-array-literals: This is another one I like, which makes it so that the places where we define an array of items (often to use with Tcl_NewListObj) are much easier to read. c11-automarker: This uses C11 variadic macros to add the NULL to the end of Tcl_SetErrorCode; this is likely to be a good thing to adopt into the public API at some point too; it reduces the blunder rate! (Also applies to other APIs that use the same pattern, but Tcl internally doesn't make much use of them.) c11-bool: This starts the process of adopting the bool type. We need to do more on this. (Note that I've found that passing a bool* instead of an int* or returning a bool instead of an int to be marked as an incompatible API change by various compilers; yuck.) c11-generic-oo-api: This uses a little magic to make a messy type split in TclOO into something that will be nicer to use. c11-printf-result: This is a big change, though entirely internal (for now). It uses variadic macros to make a call TclPrintfResult(interp, "pattern", ...), which gets us back to the ease of use for error message generation that Tcl 7 had with sprintf(interp->result, "pattern", ...) except now it's safe against buffer overruns and so on. Currently just for errors, but could be extended elsewhere and also migrated to the public API. c11-varargs-nr-add-callback: This is another application of C11 variadic macros, this time to allow omission of trailing NULL arguments in the cases where the argument is just a dummy value. There's more bits to extract (such as the reorganisation of TRACE macros in TEBC) but those are the key ones so far. Donal. ________________________________ From: Donal Fellows <don...@ma...> Sent: Monday, October 20, 2025 16:43 To: Harald Oehlmann <har...@el...>; Tcl Core List <tcl...@li...> Subject: Re: [TCLCORE] Report of Biweekly telco on 20th of October at 12:00 UTC I'll talk about this more in a follow-up message. |