Uploaded image for project: 'Apache HAWQ (Retired)'
  1. Apache HAWQ (Retired)
  2. HAWQ-1181 Improve the code quality of Apache HAWQ.
  3. HAWQ-1184

Fix risky "-Wshift-negative-value, -Wparentheses-equality, -Wtautological-compare" types of compile warnings under osx

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0.0-incubating
    • Build
    • None

    Description

      http://pastebin.com/DwGqcxr8

      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.
      

      Attachments

        Issue Links

          Activity

            People

              xunzhang Hong Wu
              xunzhang Hong Wu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: