]> git.draconx.ca Git - cdecl99.git/commit
tests: Fix gen-typegen.awk on AIX.
authorNick Bowler <nbowler@draconx.ca>
Wed, 3 Jan 2024 03:13:31 +0000 (22:13 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 3 Jan 2024 04:55:39 +0000 (23:55 -0500)
commita49a9f1f9f8c50a7f749a7e3b9ca69e1ccb6bcb1
tree7d26a8b88cef76786ce17b7917d8027bb9a6c73f
parent198b77a35965824ae4115a3488d3ecb72431c5f6
tests: Fix gen-typegen.awk on AIX.

With AIX 7.2 awk, assigning $0 in an END action does not update NF,
leaving it with its prior value from the last record:

  aix72% echo a b c | awk 'END { $0 = "x"; print NF; }'
  3

In the case of gen-typegen.awk, this does not result in any syntax
errors in the generated typegen.h file.  However, the resulting
randomdecl executable fails to produce any declarations with more
than one type specifier in any given specifier list.

Fortunately the randomdecl sanity test caught this problem, because the
_Imaginary and _Complex specifiers were not being generated (as these
are the only type specifiers that never appear by themselves).

Work around the problem by using split instead.
t/gen-typegen.awk