[jira] [Updated] (HAWQ-1188) Fix "-Wtautological-constant-out-of-range-compare, -Wtautological-compare, -Wpointer-bool-conversion, -Wnon-literal-null-conversion, -Wincompatible-pointer-types, -Wlogica

2016-12-03 Thread hongwu (JIRA)

 [ 
https://issues.apache.org/jira/browse/HAWQ-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hongwu updated HAWQ-1188:
-
Issue Type: Sub-task  (was: Improvement)
Parent: HAWQ-1181

> 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
>
> {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(>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 > 1 || gp->type > 10 || 
> gp->size > 10)
>    ^ ~~
> 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
>  
> 

[jira] [Updated] (HAWQ-1184) Fix risky "-Wshift-negative-value, -Wparentheses-equality, -Wtautological-compare" types of compile warnings under osx

2016-12-03 Thread hongwu (JIRA)

 [ 
https://issues.apache.org/jira/browse/HAWQ-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hongwu updated HAWQ-1184:
-
Issue Type: Sub-task  (was: Improvement)
Parent: HAWQ-1181

> Fix risky "-Wshift-negative-value, -Wparentheses-equality, 
> -Wtautological-compare" types of compile warnings under osx
> --
>
> Key: HAWQ-1184
> URL: https://issues.apache.org/jira/browse/HAWQ-1184
> Project: Apache HAWQ
>  Issue Type: Sub-task
>  Components: Build
>Reporter: hongwu
>Assignee: hongwu
> Fix For: 2.0.1.0-incubating
>
>
> http://pastebin.com/DwGqcxr8
> {code}
> url.c:1564:69: warning: shifting a negative signed value is undefined 
> [-Wshift-negative-value]
> pstate->cur_lineno = line_number ? line_number - 1 : 
> (int64) - 1 << 63;
>  
> ~~~ ^
> heap.c:1615:19: warning: equality comparison with extraneous parentheses 
> [-Wparentheses-equality]
> if ((relstorage == RELSTORAGE_PARQUET))
>  ~~~^
> planner.c:679:26: warning: equality comparison with extraneous parentheses 
> [-Wparentheses-equality]
> if ((resourceLife == QRL_ONCE)) {
>  ~^~~
> ./regc_locale.c:358:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isdigit((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:364:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isalpha((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:370:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isalnum((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:376:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isupper((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:382:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && islower((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:388:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isgraph((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:394:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isprint((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:400:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && ispunct((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:406:12: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> return (c >= 0 && c <= UCHAR_MAX && isspace((unsigned char) c));
> ~ ^  ~
> ./regc_locale.c:412:8: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> if (c >= 0 && c <= UCHAR_MAX)
> ~ ^  ~
> ./regc_locale.c:420:8: warning: comparison of unsigned expression >= 0 is 
> always true [-Wtautological-compare]
> if (c >= 0 && c <= UCHAR_MAX)
> ~ ^  ~
> 11 warnings generated.
> 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])
> ~~ ^ ~
> /Users/wuhong/Desktop/2016-Pivotal/Code/github/incubator-hawq/src/bin/gpfdist/src/gpfdist/gpfdist.c:2515:41:
>  warning: comparison of unsigned expression >= 0 is always true
>   [-Wtautological-compare]
> if (r->in.davailable - buf_space_left >= 0)
> ~ ^  ~
> pg_filesystem.c:387:11: warning: comparison of unsigned enum expression < 0 
> is always false [-Wtautological-compare]
> if(ftype < 0 || ftype >= FSYS_FUNC_TOTALNUM)
>~ ^ ~
> pg_filesystem.c:397:11: warning: comparison of unsigned enum expression < 0 
> is always false [-Wtautological-compare]
> if(ftype < 0 || ftype >= FSYS_FUNC_TOTALNUM)
>~ ^ ~
> 2 warnings generated.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HAWQ-1187) Fix "-Wsometimes-uninitialized, -Wsizeof-pointer-memaccess, -Wdangling-else, -Wheader-guard, -Wenum-conversion, -Winvalid-source-encoding" compile warnings under osx

2016-12-03 Thread hongwu (JIRA)

 [ 
https://issues.apache.org/jira/browse/HAWQ-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hongwu updated HAWQ-1187:
-
Issue Type: Sub-task  (was: Improvement)
Parent: HAWQ-1181

> Fix "-Wsometimes-uninitialized, -Wsizeof-pointer-memaccess, -Wdangling-else, 
> -Wheader-guard, -Wenum-conversion, -Winvalid-source-encoding" compile 
> warnings under osx
> -
>
> Key: HAWQ-1187
> URL: https://issues.apache.org/jira/browse/HAWQ-1187
> Project: Apache HAWQ
>  Issue Type: Sub-task
>  Components: Build
>Reporter: hongwu
>Assignee: hongwu
>
> http://pastebin.com/VWSuCwsC
> {code}
> aosegfiles.c:1105:6: warning: variable 'returnDatum' is used uninitialized 
> whenever 'if' condition is false [-Wsometimes-uninitialized]
> if (RelationIsAoRows(parentrel))
> ^~~
> ../../../../src/include/utils/rel.h:364:2: note: expanded from macro 
> 'RelationIsAoRows'
> ((bool)(((relation)->rd_rel->relstorage == RELSTORAGE_AOROWS)))
> ^~~
> aosegfiles.c:1112:9: note: uninitialized use occurs here
> return returnDatum;
>^~~
> aosegfiles.c:1105:2: note: remove the 'if' if its condition is always true
> if (RelationIsAoRows(parentrel))
> ^~~~
> aosegfiles.c:1094:21: note: initialize the variable 'returnDatum' to silence 
> this warning
> Datum   returnDatum;
>^
> = 0
> tablecmds.c:902:7: warning: variable 'result' is used uninitialized whenever 
> 'if' condition is false [-Wsometimes-uninitialized]
> if (astate)
> ^~
> tablecmds.c:905:10: note: uninitialized use occurs here
> return result;
>^~
> tablecmds.c:902:3: note: remove the 'if' if its condition is always true
> if (astate)
> ^~~
> tablecmds.c:803:14: note: initialize the variable 'result' to silence this 
> warning
> Datum result;
> ^
>  = 0
> tablecmds.c:4740:15: warning: variable 'l1' is used uninitialized whenever 
> 'if' condition is false [-Wsometimes-uninitialized]
> else if (!is_at)
>  ^~
> tablecmds.c:4750:23: note: uninitialized use occurs here
> if (IsA(linitial(l1), A_Const) ||
>  ^~
> ../../../src/include/nodes/pg_list.h:124:41: note: expanded from macro 
> 'linitial'
> #define linitial(l) lfirst(list_head(l))
>  ^
> ../../../src/include/nodes/pg_list.h:120:25: note: expanded from macro 
> 'lfirst'
> #define lfirst(lc)  ((lc)->data.ptr_value)
>   ^~
> ../../../src/include/nodes/nodes.h:595:39: note: expanded from macro 'IsA'
> #define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_)
>  ^~~
> ../../../src/include/nodes/nodes.h:549:37: note: expanded from macro 'nodeTag'
> #define nodeTag(nodeptr)(((Node*)(nodeptr))->type)
>   ^~~
> tablecmds.c:4740:11: note: remove the 'if' if its condition is always true
> else if (!is_at)
>  ^~~
> tablecmds.c:4729:14: note: initialize the variable 'l1' to silence this 
> warning
> List *l1;
> ^
>  = NULL
> setrefs.c:1465:7: warning: variable 'bitmapqualorig_p' is used uninitialized 
> whenever 'if' condition is false [-Wsometimes-uninitialized]
> if (IsA(inner_plan, BitmapHeapScan))
> ^~~
> ../../../../src/include/nodes/nodes.h:595:30: note: expanded from macro 'IsA'
> #define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_)
> ^~~~
> setrefs.c:1473:28: note: uninitialized use occurs here
> if (NumRelids((Node *) (*bitmapqualorig_p)) > 1)
>  ^~~~
> setrefs.c:1465:3: note: remove the 'if' if its condition is always true
>   

[GitHub] incubator-hawq issue #1033: HAWQ-1183. Writable external table with Hash dis...

2016-12-03 Thread paul-guo-
Github user paul-guo- commented on the issue:

https://github.com/apache/incubator-hawq/pull/1033
  
@huor 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-03 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1036

HAWQ-1188. Fix "-Wtautological-constant-out-of-range-compare, 
-Wtautological-compare, -Wpointer-bool-conversion, 
-Wnon-literal-null-conversion, -Wincompatible-pointer-types, 
-Wincompatible-pointer-types-discards-qualifiers, -Wlogical-not-parentheses" 
compile warnings under osx.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1188

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1036.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1036


commit 47361ae71f8c90930c68985245aeef669437574b
Author: xunzhang 
Date:   2016-12-03T08:14:10Z

HAWQ-1188. Fix "-Wtautological-constant-out-of-range-compare, 
-Wtautological-compare, -Wpointer-bool-conversion, 
-Wnon-literal-null-conversion, -Wincompatible-pointer-types, 
-Wincompatible-pointer-types-discards-qualifiers, -Wlogical-not-parentheses" 
compile warnings under osx.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1036: HAWQ-1188. Fix "-Wtautological-constant-out-of-r...

2016-12-03 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1036
  
also cc @stanlyxiang 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1036: HAWQ-1188. Fix "-Wtautological-constant-out-of-r...

2016-12-03 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1036
  
cc @paul-guo- @huor 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---