]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Replace ALLOC_STRUCT with specialized macros.
authorNick Bowler <nbowler@draconx.ca>
Mon, 24 Jul 2023 23:57:56 +0000 (19:57 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 28 Jul 2023 04:20:58 +0000 (00:20 -0400)
commitccab8e9fa4419c944f831612d5b5474c847485fa
tree5d93dec7c07aa7ddc95c76353530c782899c5e01
parent1b56fac4a07ed3ef680a46639c8e8e5bae4767e9
libcdecl: Replace ALLOC_STRUCT with specialized macros.

While there is some appeal to this generic "do everything" macro,
it depends on a bunch of modern C syntax (variadic macros, compound
literals, designated initializers) which is not always correctly
implemented.  We've already had to work around at least one compiler
bug in the code directly related to this macro.

Using specialized macros for each kind of allocation works better
on older implementations, and moreover we seem to get more compact
code out of modern ones too, probably because compound literals
initialize all members and we don't always need that.
src/parse.y