Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-21398

Casting to DECIMAL with no size generates invalid C++ code

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.6
    • Fix Version/s: 7.0.12
    • Component/s: Code Generator
    • Labels:
      None
    • Environment:
      CentOS 7.4.1708
      gcc 4.8.5.20150623

      Description

      Customer with a large ECL codebase recently upgraded from 6.4.24 to 7.0.6. Upon submitting a job to Thor, the compile failed with a large number of "large integer implicitly truncated to unsigned type [-Werror=overflow]" errors.

      Looking at the eclccserver compiler log, I find:

      ---------- compiler output --------------
      W20190131-101535_6.cpp: In member function ‘virtual size32_t cAc3761::transform(ARowBuilder&, unsigned int*, const char**)’:
      W20190131-101535_6.cpp:43240:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
          DecSetPrecision(4294967281U,4294967281U);
                                                 ^
      W20190131-101535_6.cpp:43240:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
      W20190131-101535_6.cpp: In member function ‘virtual size32_t cAc3770::transform(ARowBuilder&, unsigned int*, const char**)’:
      W20190131-101535_6.cpp:43730:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
          DecSetPrecision(4294967281U,4294967281U);
                                                 ^
      W20190131-101535_6.cpp:43730:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
      W20190131-101535_6.cpp: In member function ‘virtual size32_t cAc3778::transform(ARowBuilder&, unsigned int*, const char**)’:
      W20190131-101535_6.cpp:44371:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
          DecSetPrecision(4294967281U,4294967281U);
                                                 ^
      W20190131-101535_6.cpp:44371:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
      At global scope:
      cc1plus: error: unrecognized command line option "-Wno-tautological-compare" [-Werror]
      cc1plus: all warnings being treated as errors
      W20190131-101535_7.cpp: In member function ‘virtual size32_t cAc3841::transform(ARowBuilder&, unsigned int*, const char**)’:
      W20190131-101535_7.cpp:2229:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
          DecSetPrecision(4294967281U,4294967281U);
                                                 ^
      W20190131-101535_7.cpp:2229:43: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
      W20190131-101535_7.cpp: In member function ‘virtual size32_t cAc3880::transform(ARowBuilder&, const void*)’:
      W20190131-101535_7.cpp:7683:42: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
         DecSetPrecision(4294967281U,4294967281U);
                                                ^
      W20190131-101535_7.cpp:7683:42: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
      At global scope:
      cc1plus: error: unrecognized command line option "-Wno-tautological-compare" [-Werror]
      cc1plus: all warnings being treated as errors
      
      --------- end compiler output -----------
      

      Enclosed is a ZAP from the failing workunit and a file containing all of the interim files generated by eclccserver, along with the log file.

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              dcamper Dan S. Camper
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: