[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] { .field = value } struct initialization alternative

From: Pascal Cuoq
Subject: Re: [Tinycc-devel] { .field = value } struct initialization alternative
Date: Sun, 21 Jul 2019 19:55:22 +0000


On 21 Jul 2019, at 21:37, Ivan Medoedov <address@hidden> wrote:

No, it's a compilation error (error: field expected), and I can't reproduce it in a small program. The original file has hundreds of thousands of loc.

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]