|
From: | Pascal Cuoq |
Subject: | Re: [Tinycc-devel] { .field = value } struct initialization alternative |
Date: | Sun, 21 Jul 2019 19:55:22 +0000 |
Hello,
Large inputs that cause unwarranted compilation errors are easy to make small by using C-Reduce: https://embed.cs.utah.edu/creduce/ (probably already a package of your reputable Linux distribution).
C-Reduce takes as argument a script that indicates that a variant of the initial input is still interesting. In your case, the input is interesting because it is accepted by (say) “gcc -std=c11 -pedantic” and when compiled with “tcc”, causes
stderr to contain “error: field expected”.
It takes a bit of getting used to to wield C-Reduce efficiently; for instance not specifying “-std=c11 -pedantic” or not grepping specifically for “error: field expected” is likely to yield a different bug than the one that was initially bothering
you, that C-Reduce will introduce as it reduces the input. John Regehr compares it to “every story where a genie is in a position to grant a wish”.
Even with the quirks that manifest themselves the first couple of times you use it, C-Reduce still helps getting bugs fixed faster than reducing inputs by hand or not reporting bugs properly because reducing them looks daunting.
Pascal
|
[Prev in Thread] | Current Thread | [Next in Thread] |