aboutsummaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2021-12-11 11:32:25 +0000
committerSimon Tatham <anakin@pobox.com>2021-12-11 12:00:37 +0000
commitd399a6b23051335ce3107f11822ae352816fcd50 (patch)
tree803208654439e31c39d30931af87cd6cf6a5d172 /pattern.c
parentbb1432c0ad0ba2955df9483dde67a987fb946ed8 (diff)
downloadpuzzles-d399a6b23051335ce3107f11822ae352816fcd50.zip
puzzles-d399a6b23051335ce3107f11822ae352816fcd50.tar.gz
puzzles-d399a6b23051335ce3107f11822ae352816fcd50.tar.bz2
puzzles-d399a6b23051335ce3107f11822ae352816fcd50.tar.xz
tree234: avoid an uninitialised-variable warning.
Apparently, some compilers can't work out that the pattern if (!t->root) { special-case handler followed by early return } n = t->root; while (n) { ... } will execute the while loop at least once, on the grounds that the _first_ test for n being non-NULL must pass, because we initialised n from t->root which can't be NULL on any code path where we didn't take the early return. So they might give an uninitialised-variable warning for the variable 'ki', which is initialised inside the while loop. Compilers, eh. But it's easy enough to turn the while into a do-while, so that even the least alert compiler will know it runs at least once.
Diffstat (limited to 'pattern.c')
0 files changed, 0 insertions, 0 deletions