You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "hongwu (JIRA)" <ji...@apache.org> on 2016/12/07 16:12:59 UTC
[jira] [Resolved] (HAWQ-1188) Fix
"-Wtautological-constant-out-of-range-compare, -Wtautological-compare,
-Wpointer-bool-conversion, -Wnon-literal-null-conversion,
-Wincompatible-pointer-types, -Wlogical-not-parentheses" compile warnings
under osx.
[ https://issues.apache.org/jira/browse/HAWQ-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
hongwu resolved HAWQ-1188.
--------------------------
Resolution: Fixed
Fix Version/s: 2.0.1.0-incubating
> Fix "-Wtautological-constant-out-of-range-compare, -Wtautological-compare, -Wpointer-bool-conversion, -Wnon-literal-null-conversion, -Wincompatible-pointer-types, -Wlogical-not-parentheses" compile warnings under osx.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HAWQ-1188
> URL: https://issues.apache.org/jira/browse/HAWQ-1188
> Project: Apache HAWQ
> Issue Type: Sub-task
> Components: Build
> Reporter: hongwu
> Assignee: hongwu
> Fix For: 2.0.1.0-incubating
>
>
> {code}
> fe-exec.c:2389:27: warning: comparison of constant 8 with expression of type 'ExecStatusType' is always false [-Wtautological-constant-out-of-range-compare]
> if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
> ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DUNSAFE_STAT_OK -I. -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -I../../../src/port -c -o fe-exec.o fe-exec.c
> fe-exec.c:2671:32: warning: comparison of constant 8 with expression of type 'ExecStatusType' is always false [-Wtautological-constant-out-of-range-compare]
> if ((int)status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
> ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> md.c:1289:77: warning: comparison of constant 0 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
> if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ) < 0)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
> 2 warnings generated.
> segadmin.c:112:30: warning: comparison of constant 32 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
> if ((flags && STANDBY_ONLY) == STANDBY_ONLY)
> ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I../../../src/interfaces/libpq -I../../../src/backend/gp_libpq_fe -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o cdbgang.o cdbgang.c
> cdbgang.c:447:61: warning: comparison of constant 10 with expression of type 'GangType' (aka 'enum GangType') is always false [-Wtautological-constant-out-of-range-compare]
> if (gp->gang_id < 1 || gp->gang_id > 100000000 || gp->type > 10 || gp->size > 100000)
> ~~~~~~~~ ^ ~~
> 1 warning generated.
> fe-exec.c:2971:20: warning: address of array 'res->cmdStatus' will always evaluate to 'true' [-Wpointer-bool-conversion]
> if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
> ~~~~~~^~~~~~~~~
> fe-exec.c:2995:9: warning: address of array 'res->cmdStatus' will always evaluate to 'true' [-Wpointer-bool-conversion]
> !res->cmdStatus ||
> ~~~~~~^~~~~~~~~
> 3 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I../../../src/interfaces/libpq -I../../../src/backend/gp_libpq_fe -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o cdbsreh.o cdbsreh.c
> cdbsreh.c:350:14: warning: address of array 'cdbsreh->filename' will always evaluate to 'true' [-Wpointer-bool-conversion]
> if(cdbsreh->filename)
> ~~ ~~~~~~~~~^~~~~~~~
> 1 warning generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DFRONTEND -DUNSAFE_STAT_OK -I. -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -I../../../src/port -I../../../src/port -DSO_MAJOR_VERSION=5 -c -o fe-exec.o fe-exec.c
> fe-exec.c:2389:13: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
> if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
> ~~~~~~ ^ ~
> fe-exec.c:2389:27: warning: comparison of constant 8 with expression of type 'ExecStatusType' is always false [-Wtautological-constant-out-of-range-compare]
> if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
> ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fe-exec.c:2689:20: warning: address of array 'res->cmdStatus' will always evaluate to 'true' [-Wpointer-bool-conversion]
> if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
> ~~~~~~^~~~~~~~~
> fe-exec.c:2713:9: warning: address of array 'res->cmdStatus' will always evaluate to 'true' [-Wpointer-bool-conversion]
> !res->cmdStatus ||
> ~~~~~~^~~~~~~~~
> 4 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I../../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o md.o md.c
> md.c:1289:8: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
> if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ) < 0)
> ^ ~
> md.c:1289:8: note: add parentheses after the '!' to evaluate the comparison first
> if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ) < 0)
> ^
> ( )
> md.c:1289:8: note: add parentheses around left hand side expression to silence this warning
> if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ) < 0)
> ^
> ( )
> md.c:1289:77: warning: comparison of constant 0 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
> if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ) < 0)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
> 2 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DFRONTEND -DUNSAFE_STAT_OK -I. -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -I../../../src/port -I../../../src/port -DSO_MAJOR_VERSION=5 -c -o fe-exec.o fe-exec.c
> fe-exec.c:2389:13: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
> if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
> ~~~~~~ ^ ~
> fe-exec.c:2389:27: warning: comparison of constant 8 with expression of type 'ExecStatusType' is always false [-Wtautological-constant-out-of-range-compare]
> if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
> ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fe-exec.c:2689:20: warning: address of array 'res->cmdStatus' will always evaluate to 'true' [-Wpointer-bool-conversion]
> if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
> ~~~~~~^~~~~~~~~
> fe-exec.c:2713:9: warning: address of array 'res->cmdStatus' will always evaluate to 'true' [-Wpointer-bool-conversion]
> !res->cmdStatus ||
> ~~~~~~^~~~~~~~~
> 4 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o heap.o heap.c
> heap.c:910:13: warning: expression which evaluates to zero treated as a null pointer constant of type 'HeapTuple' (aka 'struct HeapTupleData *') [-Wnon-literal-null-conversion]
> rel, InvalidOid);
> ^~~~~~~~~~
> ../../../src/include/postgres_ext.h:34:21: note: expanded from macro 'InvalidOid'
> #define InvalidOid ((Oid) 0)
> ^~~~~~~~~
> 1 warning generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DUNSAFE_STAT_OK -I. -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -I../../../src/port -c -o fe-connect.o fe-connect.c
> fe-connect.c:439:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'PGconn *' (aka 'struct pg_conn *') [-Wnon-literal-null-conversion]
> return false;
> ^~~~~
> ../../../src/include/c.h:215:15: note: expanded from macro 'false'
> #define false ((bool) 0)
> ^~~~~~~~~~
> 1 warning generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DFRONTEND -DUNSAFE_STAT_OK -I. -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -I../../../src/port -I../../../src/port -DSO_MAJOR_VERSION=5 -c -o fe-connect.o fe-connect.c
> fe-connect.c:449:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'PGconn *' (aka 'struct pg_conn *') [-Wnon-literal-null-conversion]
> return false;
> ^~~~~
> ../../../src/include/c.h:215:15: note: expanded from macro 'false'
> #define false ((bool) 0)
> ^~~~~~~~~~
> 1 warning generated.
> createplan.c:1150:23: warning: incompatible pointer types passing 'Node *' (aka 'struct Node *') to parameter of type 'List *' (aka 'struct List *') [-Wincompatible-pointer-types]
> relation, ctx->root->parse->jointree->quals);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../../../../src/include/access/hd_work_mgr.h:34:109: note: passing argument to parameter 'quals' here
> extern char** map_hddata_2gp_segments(char *uri, int total_segs, int working_segs, Relation relation, List* quals);
> ^
> 2 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I. -I../../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o guc.o guc.c
> guc.c:5522:3: warning: incompatible pointer types initializing 'int *' with an expression of type 'int64 *' (aka 'long *') [-Wincompatible-pointer-types]
> &Gp_interconnect_transmit_timeout,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> guc.c:13689:33: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
> setSimpleStringRef(&valuestr, newval, strlen(newval));
> ^~~~~~
> ../../../../src/include/resourcemanager/utils/simplestring.h:55:50: note: passing argument to parameter 'content' here
> void setSimpleStringRef(SimpStringPtr str, char *content, int length);
> ^
> rmcomm_AsyncComm.c:114:3: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
> setSimpleStringNoLen(&(commbuffer->ClientHostname), clienthostname);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../../../../src/include/resourcemanager/utils/simplestring.h:115:37: note: expanded from macro 'setSimpleStringNoLen'
> setSimpleStringWithContent((str), (content), strlen((content)))
> ^~~~~~~~~
> ../../../../src/include/resourcemanager/utils/simplestring.h:48:25: note: passing argument to parameter 'content' here
> char *content,
> ^
> 2 warnings generated.
> rmcomm_QD2RM.c:1910:33: warning: incompatible pointer types passing 'int64 *' (aka 'long *') to parameter of type 'int64_t *' (aka 'long long *') [-Wincompatible-pointer-types]
> SimpleStringToInt64(token2, &(volinfo[i].datavolume));
> ^~~~~~~~~~~~~~~~~~~~~~~~
> ../include/utils/simplestring.h:66:54: note: passing argument to parameter 'value' here
> int SimpleStringToInt64(SimpStringPtr str, int64_t *value);
> ^
> rmcomm_QD2RM.c:2628:37: warning: incompatible pointer types passing 'int64 *' (aka 'long *') to parameter of type 'int64_t *' (aka 'long long *') [-Wincompatible-pointer-types]
> SimpleStringToInt64(token2, &(volinfo[i].datavolume));
> ^~~~~~~~~~~~~~~~~~~~~~~~
> ../include/utils/simplestring.h:66:54: note: passing argument to parameter 'value' here
> int SimpleStringToInt64(SimpStringPtr str, int64_t *value);
> ^
> resourcepool.c:4931:35: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
> appendSelfMaintainBuffer(&buf, SegStatusDesc[idx], strlen(SegStatusDesc[idx]));
> ^~~~~~~~~~~~~~~~~~
> ../../../src/include/resourcemanager/utils/memutilities.h:118:16: note: passing argument to parameter 'source' here
> char *source,
> ^
> 18 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -pthread -Wno-deprecated-declarations -DFRONTEND -I../../../src/interfaces/libpq -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o pg_backup_files.o pg_backup_files.c
> pg_backup_files.c:239:11: warning: incompatible pointer types assigning to 'gzFile *' (aka 'struct gzFile_s **') from 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> tctx->FH = gzopen(tctx->filename, fmode);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> pg_backup_files.c:253:34: warning: incompatible pointer types passing 'gzFile *' (aka 'struct gzFile_s **') to parameter of type 'gzFile' (aka 'struct gzFile_s *'); dereference with * [-Wincompatible-pointer-types]
> GZWRITE((void *) data, 1, dLen, tctx->FH);
> ^~~~~~~~
> *
> ./pg_backup_archiver.h:47:38: note: expanded from macro 'GZWRITE'
> #define GZWRITE(p, s, n, fh) gzwrite(fh, p, (n) * (s))
> ^~
> /usr/include/zlib.h:1351:40: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
> ^
> pg_backup_files.c:264:14: warning: incompatible pointer types passing 'gzFile *' (aka 'struct gzFile_s **') to parameter of type 'gzFile' (aka 'struct gzFile_s *'); dereference with * [-Wincompatible-pointer-types]
> if (GZCLOSE(tctx->FH) != 0)
> ^~~~~~~~
> *
> ./pg_backup_archiver.h:46:29: note: expanded from macro 'GZCLOSE'
> #define GZCLOSE(fh) gzclose(fh)
> ^~
> /usr/include/zlib.h:1521:43: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzclose OF((gzFile file));
> ^
> pg_backup_files.c:283:9: warning: incompatible pointer types assigning to 'FILE *' (aka 'struct __sFILE *') from 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> AH->FH = gzopen(filename, "rb");
> ^ ~~~~~~~~~~~~~~~~~~~~~~
> pg_backup_files.c:291:37: warning: incompatible pointer types passing 'FILE *' (aka 'struct __sFILE *') to parameter of type 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> while ((cnt = GZREAD(buf, 1, 4095, AH->FH)) > 0)
> ^~~~~~
> ./pg_backup_archiver.h:48:36: note: expanded from macro 'GZREAD'
> #define GZREAD(p, s, n, fh) gzread(fh, p, (n) * (s))
> ^~
> /usr/include/zlib.h:1323:39: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
> ^
> pg_backup_files.c:297:14: warning: incompatible pointer types passing 'FILE *' (aka 'struct __sFILE *') to parameter of type 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> if (GZCLOSE(AH->FH) != 0)
> ^~~~~~
> ./pg_backup_archiver.h:46:29: note: expanded from macro 'GZCLOSE'
> #define GZCLOSE(fh) gzclose(fh)
> ^~
> /usr/include/zlib.h:1521:43: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzclose OF((gzFile file));
> ^
> pg_backup_files.c:503:11: warning: incompatible pointer types assigning to 'gzFile *' (aka 'struct gzFile_s **') from 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> tctx->FH = gzopen(fname, fmode);
> ^ ~~~~~~~~~~~~~~~~~~~~
> pg_backup_files.c:523:14: warning: incompatible pointer types passing 'gzFile *' (aka 'struct gzFile_s **') to parameter of type 'gzFile' (aka 'struct gzFile_s *'); dereference with * [-Wincompatible-pointer-types]
> if (GZCLOSE(tctx->FH) != 0)
> ^~~~~~~~
> *
> ./pg_backup_archiver.h:46:29: note: expanded from macro 'GZCLOSE'
> #define GZCLOSE(fh) gzclose(fh)
> ^~
> /usr/include/zlib.h:1521:43: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzclose OF((gzFile file));
> ^
> 8 warnings generated.
> pg_backup_tar.c:399:12: warning: incompatible pointer types assigning to 'ThingFile *' (aka 'struct __sFILE *') from 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> tm->zFH = gzdopen(dup(fileno(tm->tmpFH)), fmode);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> pg_backup_tar.c:527:15: warning: incompatible pointer types passing 'ThingFile *' (aka 'struct __sFILE *') to parameter of type 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> if (GZCLOSE(th->zFH) != 0)
> ^~~~~~~
> ./pg_backup_archiver.h:46:29: note: expanded from macro 'GZCLOSE'
> #define GZCLOSE(fh) gzclose(fh)
> ^~
> /usr/include/zlib.h:1521:43: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzclose OF((gzFile file));
> ^
> pg_backup_tar.c:623:49: warning: incompatible pointer types passing 'ThingFile *' (aka 'struct __sFILE *') to parameter of type 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> res = GZREAD(&((char *) buf)[used], 1, len, th->zFH);
> ^~~~~~~
> ./pg_backup_archiver.h:48:36: note: expanded from macro 'GZREAD'
> #define GZREAD(p, s, n, fh) gzread(fh, p, (n) * (s))
> ^~
> /usr/include/zlib.h:1323:39: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
> ^
> pg_backup_tar.c:660:39: warning: incompatible pointer types passing 'ThingFile *' (aka 'struct __sFILE *') to parameter of type 'gzFile' (aka 'struct gzFile_s *') [-Wincompatible-pointer-types]
> res = GZWRITE((void *) buf, 1, len, th->zFH);
> ^~~~~~~
> ./pg_backup_archiver.h:47:38: note: expanded from macro 'GZWRITE'
> #define GZWRITE(p, s, n, fh) gzwrite(fh, p, (n) * (s))
> ^~
> /usr/include/zlib.h:1351:40: note: passing argument to parameter 'file' here
> ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
> ^
> 4 warnings generated.
> gcc -O3 -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/Cellar/curl/7.49.1/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -pthread -DFRONTEND -I. -I. -I../../../src/interfaces/libpq -I../../../src/bin/pg_dump -I../../../src/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libhdfs3/build/install/usr/local/hawq/include -I/Users/wuhong/Desktop/tmp/incubator-hawq/depends/libyarn/build/install/usr/local/hawq/include -c -o describe.o describe.c
> describe.c:4248:9: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
> strtok(user_pattern, ".");
> ^~~~~~~~~~~~
> /usr/include/string.h:90:20: note: passing argument to parameter '__str' here
> char *strtok(char *__str, const char *__sep);
> ^
> describe.c:4349:26: warning: incompatible pointer types passing 'printQueryOpt *' (aka 'struct printQueryOpt *') to parameter of type 'const printTableOpt *' (aka 'const struct printTableOpt *') [-Wincompatible-pointer-types]
> printTableInit(&cont, &myopt, title.data, cols, total_fields);
> ^~~~~~
> ./print.h:156:28: note: passing argument to parameter 'opt' here
> const printTableOpt *opt, const char *title,
> ^
> 2 warnings generated.
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)