From baff259ebf45d0a0231553d767c45f8da404944e Mon Sep 17 00:00:00 2001 From: Marko Rauhamaa Date: Sat, 11 Jul 2026 11:33:28 +0300 Subject: [PATCH] Fix fstracecheck2 so trace declarations are actually validated. With plain -E preprocessing, GCC inserts #line directives inside FSTRACE_DECL expansions, splitting fstrace_specify() across several lines. The declaration regex never matches, so fstracecheck2 finds no events and silently skips validation. Preprocess with -P to suppress linemarkers, and compile checks with -Wformat -Werror like v1. Co-authored-by: Cursor --- bin/fstracecheck2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/fstracecheck2 b/bin/fstracecheck2 index d9e7555..75c5326 100755 --- a/bin/fstracecheck2 +++ b/bin/fstracecheck2 @@ -166,6 +166,7 @@ def form_tstcmd(argv, dirpath, pathname, test_source): arch = False elif arg == "-c": yield "-E" + yield "-P" elif arg == "-o": obj = True yield arg @@ -236,6 +237,7 @@ def form_ppcmd(argv, dirpath, pathname, x_output): arch = False elif arg == "-c": yield "-E" + yield "-P" elif arg == "-o": obj = True yield arg @@ -335,6 +337,8 @@ def form_cccmd(argv, dirpath, pathname, pp_output): else: yield arg yield "-Wno-unused-command-line-argument" + yield "-Wformat" + yield "-Werror" yield "-O0" # quicker