[DTrace-devel] [PATCH 3/5] test: preprocessor: work on GCC 16

Nick Alcock nick.alcock at oracle.com
Mon Oct 6 15:28:26 UTC 2025


GCC commit c397a8c12296b75a91ae51e4889debf023e6c338 ("libcpp, genmatch:
Use gcc_diag instead of printf for libcpp diagnostics") made libcpp
quote identifiers and tokens in diagnostics like the rest of GCC does.
We have several tests that rely on the old error formatting: sed away
quotes and smartquotes into quotes or nothing (as appropriate to match
older GCCs), until such time as GCC 15 is obsolete (a long long time
away).

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 test/unittest/preprocessor/err.defincomp.r.p   | 1 +
 test/unittest/preprocessor/err.ifdefincomp.r.p | 4 ++++
 test/unittest/preprocessor/err.incompelse.r.p  | 4 ++++
 test/unittest/preprocessor/err.mulelse.r.p     | 1 +
 4 files changed, 10 insertions(+)
 create mode 120000 test/unittest/preprocessor/err.defincomp.r.p
 create mode 100755 test/unittest/preprocessor/err.ifdefincomp.r.p
 create mode 100755 test/unittest/preprocessor/err.incompelse.r.p
 create mode 120000 test/unittest/preprocessor/err.mulelse.r.p

diff --git a/test/unittest/preprocessor/err.defincomp.r.p b/test/unittest/preprocessor/err.defincomp.r.p
new file mode 120000
index 0000000000000..62577fe0b6bbd
--- /dev/null
+++ b/test/unittest/preprocessor/err.defincomp.r.p
@@ -0,0 +1 @@
+err.incompelse.r.p
\ No newline at end of file
diff --git a/test/unittest/preprocessor/err.ifdefincomp.r.p b/test/unittest/preprocessor/err.ifdefincomp.r.p
new file mode 100755
index 0000000000000..7629ac5973957
--- /dev/null
+++ b/test/unittest/preprocessor/err.ifdefincomp.r.p
@@ -0,0 +1,4 @@
+#!/usr/bin/sed -f
+# GCC 16 improved diagnostics formatting.  Until GCC 16 is the minimum
+# supported, we have to sed it back again.
+s,[‘’],",g
diff --git a/test/unittest/preprocessor/err.incompelse.r.p b/test/unittest/preprocessor/err.incompelse.r.p
new file mode 100755
index 0000000000000..ae9a6833d106d
--- /dev/null
+++ b/test/unittest/preprocessor/err.incompelse.r.p
@@ -0,0 +1,4 @@
+#!/usr/bin/sed -f
+# GCC 16 improved diagnostics formatting.  Until GCC 16 is the minimum
+# supported, we have to sed it back again.
+s,[‘’],,g
diff --git a/test/unittest/preprocessor/err.mulelse.r.p b/test/unittest/preprocessor/err.mulelse.r.p
new file mode 120000
index 0000000000000..62577fe0b6bbd
--- /dev/null
+++ b/test/unittest/preprocessor/err.mulelse.r.p
@@ -0,0 +1 @@
+err.incompelse.r.p
\ No newline at end of file
-- 
2.51.0.284.g117bcb8de7




More information about the DTrace-devel mailing list