hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Guo (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HAWQ-1182) Add Macro for unused argument and variable.
Date Thu, 01 Dec 2016 08:16:58 GMT
Paul Guo created HAWQ-1182:

             Summary: Add Macro for unused argument and variable.
                 Key: HAWQ-1182
                 URL: https://issues.apache.org/jira/browse/HAWQ-1182
             Project: Apache HAWQ
          Issue Type: Bug
            Reporter: Paul Guo
            Assignee: Lei Chang
             Fix For:

Per discussion on the dev mail list. I want to add the Macros below to help eliminate some
"unused" variable/argument warnings.

Typical cases:

1) Variable is only used with some configurations, etc. val for Assert(val). Then you could
add the code below to eliminate the warning when cassert is not enabled.


2) For argument that is explicitly unused but might be kept for compatibility, you could use

A simple patch, see below:
[pguo@host67:/data2/github/incubator-hawq-a/src/include]$ git diff
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 1138f20..9391d6b 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -513,6 +513,18 @@ extern void gp_set_thread_sigmasks(void);

 extern void OnMoveOutCGroupForQE(void);

+#define POSSIBLE_UNUSED_VAR(x) ((void)x)
+#define POSSIBLE_UNUSED_ARG(x) ((void)x)
+#ifndef UNUSED_ARG
+#define UNUSED_ARG(x)          ((void)x)
 #ifdef __cplusplus
 }   /* extern "C" */

This message was sent by Atlassian JIRA

View raw message