On 03/06/2026 3:08 pm, Leo Yan wrote:
On Tue, Jun 02, 2026 at 03:26:48PM +0100, James Clark wrote:
[...]
+# Remove open brace lines as they may not be hit depending on the compiler +sed -i \
- -e '/deterministic.c:8$/d' \
- -e '/deterministic.c:15$/d' \
- -e '/deterministic.c:23$/d' \
- "$tmpdir/script"
Is this related to the function definition?
I can see the brace lines with change below. It might be more reliable if adding unused function argument, which can give chance for hit function entry.
static int function1(void) { ...
return 0;}
Thanks, Leo
Originally I included the brace lines in the test and it was working even without function arguments, but Sashiko mentioned that they may not always be hit.
I think its point was that there is no hard rule about debug symbols for open braces and the behavior might change from one version of the compiler to the next, or whether there is a function prologue or inlining or not etc.
I don't think it's important to the test at all though? So to err on the side of caution it makes sense to not test for them. Unless there's a reason you think testing for open braces is important? Surely just testing for actual lines of code appearing in a certain order is enough.