Repository: incubator-hawq
Updated Branches:
  refs/heads/master 9a25e2c90 -> 6a6fa2755


HAWQ-1230. Introduce macro __MAYBE_UNUSED to surpress unused funtion/variable 
kind of warnings.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/6a6fa275
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/6a6fa275
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/6a6fa275

Branch: refs/heads/master
Commit: 6a6fa275565f9e24f9d8eacb89e5e1b6efb46440
Parents: 9a25e2c
Author: Paul Guo <[email protected]>
Authored: Wed Dec 21 19:02:34 2016 +0800
Committer: Paul Guo <[email protected]>
Committed: Thu Dec 22 13:52:06 2016 +0800

----------------------------------------------------------------------
 src/backend/commands/tablecmds.c | 8 ++------
 src/backend/libpq/be-secure.c    | 3 +--
 src/include/postgres.h           | 8 ++------
 3 files changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6a6fa275/src/backend/commands/tablecmds.c
----------------------------------------------------------------------
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index fc35124..f4ce8e6 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -3038,12 +3038,10 @@ renamerel(Oid myrelid, const char *newrelname, 
RenameStmt *stmt)
        char                    oldrelname[NAMEDATALEN];
        bool                    relhastriggers;
        Form_pg_class   form;
-       bool                    isSystemRelation;
+       bool __MAYBE_UNUSED     isSystemRelation;
        cqContext               cqc;
        cqContext          *pcqCtx;
 
-       POSSIBLE_UNUSED_VAR(isSystemRelation);
-
        /* if this is a child table of a partitioning configuration, complain */
        if (stmt && rel_is_child_partition(myrelid) && !stmt->bAllowPartn)
        {
@@ -14516,15 +14514,13 @@ ATPExecPartExchange(AlteredTableInfo *tab, Relation 
rel, AlterPartitionCmd *pc)
                AttrMap                 *newmap;
                AttrMap                 *oldmap;
                List                    *newcons;
-               bool                     ok;
+               bool __MAYBE_UNUSED      ok;
                bool                     validate       = intVal(pc2->arg1) ? 
true : false;
                Oid                              oldnspid       = InvalidOid;
                Oid                              newnspid       = InvalidOid;
                char                    *newNspName = NULL;
                char                    *oldNspName = NULL;
 
-               POSSIBLE_UNUSED_VAR(ok);
-
                newrel = heap_open(newrelid, AccessExclusiveLock);
                oldrel = heap_open(oldrelid, AccessExclusiveLock);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6a6fa275/src/backend/libpq/be-secure.c
----------------------------------------------------------------------
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c
index 7e6d6ae..edcdf16 100644
--- a/src/backend/libpq/be-secure.c
+++ b/src/backend/libpq/be-secure.c
@@ -318,8 +318,7 @@ rloop:
  * This function holds an interrupt before reporting this error to avoid
  * a self deadlock situation, see MPP-13718 for more info.
  */
-/* here is a warning on gcc 4.8.5 */
-static void
+static void __MAYBE_UNUSED
 report_commerror(const char *err_msg)
 {
        HOLD_INTERRUPTS();

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6a6fa275/src/include/postgres.h
----------------------------------------------------------------------
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 9391d6b..ecaea21 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -513,12 +513,8 @@ extern void gp_set_thread_sigmasks(void);
 
 extern void OnMoveOutCGroupForQE(void);
 
-#ifndef POSSIBLE_UNUSED_VAR
-#define POSSIBLE_UNUSED_VAR(x) ((void)x)
-#endif
-
-#ifndef POSSIBLE_UNUSED_ARG
-#define POSSIBLE_UNUSED_ARG(x) ((void)x)
+#ifndef __MAYBE_UNUSED
+#define __MAYBE_UNUSED __attribute__((unused))
 #endif
 
 #ifndef UNUSED_ARG

Reply via email to