summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2021-05-10 09:36:26 +0000
committerPeter Eisentraut2021-05-10 09:40:03 +0000
commitfa8fbadb934b4727a7aeff074995e799f4685a75 (patch)
tree88e4c6eed7b4d368379f4aa7638c4d298f4d404c
parent3c554100307f4e57c0881e205dbdbc173bb84d56 (diff)
Emit dummy statements for probes.d probes when disabled
When building without --enable-dtrace, emit dummy do {} while (0) statements for the stubbed-out TRACE_POSTGRESQL_foo() macros instead of empty macros that totally elide the original probe statement. This fixes the warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] introduced by b94409a02f. Author: Craig Ringer <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/20210504221531.cfvpmmdfsou6eitb%40alap3.anarazel.de
-rw-r--r--src/backend/utils/Gen_dummy_probes.pl6
-rw-r--r--src/backend/utils/Gen_dummy_probes.sed1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/utils/Gen_dummy_probes.pl b/src/backend/utils/Gen_dummy_probes.pl
index 9f3cf6baf18..4852103daf4 100644
--- a/src/backend/utils/Gen_dummy_probes.pl
+++ b/src/backend/utils/Gen_dummy_probes.pl
@@ -135,6 +135,12 @@ sub Run()
$CondReg ||= $s;
}
+ # s/$/ do {} while (0)/
+ {
+ $s = s /$/ do {} while (0)/s;
+ $CondReg ||= $s;
+ }
+
# P
{
if (/^(.*)/) { print $1, "\n"; }
diff --git a/src/backend/utils/Gen_dummy_probes.sed b/src/backend/utils/Gen_dummy_probes.sed
index aa3db59cce7..6e29d86afaf 100644
--- a/src/backend/utils/Gen_dummy_probes.sed
+++ b/src/backend/utils/Gen_dummy_probes.sed
@@ -19,5 +19,6 @@ s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2,
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6)/
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6, INT7)/
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6, INT7, INT8)/
+s/$/ do {} while (0)/
P
s/(.*$/_ENABLED() (0)/