ProcessTransformed initializer build error

Jun 24, 2014 at 3:25 PM
Hey there,

I am working on building this library using Texas Instrument’s Code Composer Studio v6 on Windows 7 64bit. I have resolved all of the errors (having to do with compatibility) but unfortunately one persists. I was able to compile the library in Visual Studio to check if it worked for me and it does. However when using CCS, it gives an error saying there is no initializer for ProcessTransformed. I have already reached out to TI for help and they may be able to shed light on the issue if it is on their end. The code you have written is beyond my level of programming ability so I don’t completely understand how to fix these errors myself. It might even be something really simply like setting the arguments to zero or their equivalent or perhaps moving its initialization somewhere else for CCS to accept it. I was wondering if you would be kind enough to help me out.

Here is a link to a picture of the build error.

https://drive.google.com/file/d/0BxaOtdETbPPBNi0yWlBzVFlQWE0/edit?usp=sharing

Thank you!
Nick
Jun 24, 2014 at 4:51 PM
Edited Jun 24, 2014 at 4:56 PM
I just learned that there is actually a more complete description of the errors available through the program so here are the details from that. It appears to be saying that the "_info(info)," passed in from the second argument, "const JlsParameters& info" of the ProcessedTransformed function is not initializing. If you are able to help, thank you!



**** Build of configuration Release for project CharLS ****

"c:\ti\ccsv6\utils\bin\gmake" -k all
'Building file: ../header.cpp'
'Invoking: C6000 Compiler'
"c:/ti/ccsv6/tools/compiler/c6000_7.4.8/bin/cl6x" -mv6700 --abi=coffabi -O2 --include_path="c:/ti/ccsv6/tools/compiler/c6000_7.4.8/include" --define=c6713 --display_error_number --verbose_diagnostics --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="header.pp" --exceptions "../header.cpp"
"..\util.h", line 47: warning #64-D: shift count is too large
{ return (n >> (LONG_BITCOUNT-1)) | 1;}
               ^
"..\util.h", line 50: warning #64-D: shift count is too large
Compilation failure
{ return i >> (LONG_BITCOUNT-1); }  
              ^
"..\processline.h", line 147: error #368:
      "ProcessTransformed<TRANSFORM>::ProcessTransformed(const
      ProcessTransformed<TRANSFORM> &)" provides no initializer for:
        reference member "ProcessTransformed<TRANSFORM>::_info"
ProcessTransformed(const ProcessTransformed&) {}
                                              ^
1 error detected in the compilation of "../header.cpp".
gmake: *** [header.obj] Error 1
'Building file: ../interface.cpp'
'Invoking: C6000 Compiler'
"c:/ti/ccsv6/tools/compiler/c6000_7.4.8/bin/cl6x" -mv6700 --abi=coffabi -O2 --include_path="c:/ti/ccsv6/tools/compiler/c6000_7.4.8/include" --define=c6713 --display_error_number --verbose_diagnostics --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="interface.pp" --exceptions "../interface.cpp"
"..\util.h", line 47: warning #64-D: shift count is too large
{ return (n >> (LONG_BITCOUNT-1)) | 1;}
               ^
"..\util.h", line 50: warning #64-D: shift count is too large
{ return i >> (LONG_BITCOUNT-1); }  
              ^
'Finished building: ../interface.cpp'
' '
'Building file: ../jpegls.cpp'
'Invoking: C6000 Compiler'
"c:/ti/ccsv6/tools/compiler/c6000_7.4.8/bin/cl6x" -mv6700 --abi=coffabi -O2 --include_path="c:/ti/ccsv6/tools/compiler/c6000_7.4.8/include" --define=c6713 --display_error_number --verbose_diagnostics --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="jpegls.pp" --exceptions "../jpegls.cpp"
"..\util.h", line 47: warning #64-D: shift count is too large
{ return (n >> (LONG_BITCOUNT-1)) | 1;}
               ^

"..\util.h", line 50: warning #64-D: shift count is too large
{ return i >> (LONG_BITCOUNT-1); }  
              ^
Compilation failure
"..\processline.h", line 147: error #368:
      "ProcessTransformed<TRANSFORM>::ProcessTransformed(const
      ProcessTransformed<TRANSFORM> &)" provides no initializer for:
        reference member "ProcessTransformed<TRANSFORM>::_info"
ProcessTransformed(const ProcessTransformed&) {}
                                              ^
"..\losslesstraits.h", line 52: warning #64-D: shift count is too large
    return (~(Pxc >> (LONG_BITCOUNT-1))) & MAXVAL;      
                     ^
"..\defaulttraits.h", line 80: warning #64-D: shift count is too large
    return (~(Pxc >> (LONG_BITCOUNT-1))) & MAXVAL;      
                     ^
"..\scan.h", line 83: warning #64-D: shift count is too large
LONG sign = LONG(mappedError << (LONG_BITCOUNT-1)) >> (LONG_BITCOUNT-1);
                                ^
"..\scan.h", line 83: warning #64-D: shift count is too large
LONG sign = LONG(mappedError << (LONG_BITCOUNT-1)) >> (LONG_BITCOUNT-1);
                                                      ^
"..\scan.h", line 91: warning #64-D: shift count is too large
LONG mappedError = (Errval >> (LONG_BITCOUNT-2)) ^ (2 * Errval);
                              ^
"..\scan.h", line 769: warning #112-D: statement is unreachable
        case COLORXFORM_HP1 : return new ProcessTransformed<TransformHp1<SAMPLE> >(pvoidOut, Info(), TransformHp1<SAMPLE>()); break;
                                                                                                                              ^
"..\scan.h", line 770: warning #112-D: statement is unreachable
        case COLORXFORM_HP2 : return new ProcessTransformed<TransformHp2<SAMPLE> >(pvoidOut, Info(), TransformHp2<SAMPLE>()); break;
                                                                                                                              ^
"..\scan.h", line 771: warning #112-D: statement is unreachable
        case COLORXFORM_HP3 : return new ProcessTransformed<TransformHp3<SAMPLE> >(pvoidOut, Info(), TransformHp3<SAMPLE>()); break;
                                                                                                                              ^
"..\scan.h", line 780: warning #112-D: statement is unreachable
        case COLORXFORM_HP1 : return new ProcessTransformed<TransformShifted<TransformHp1<USHORT> > >(pvoidOut, Info(), TransformShifted<TransformHp1<USHORT> >(shift)); break;
                                                                                                                                                                         ^
"..\scan.h", line 781: warning #112-D: statement is unreachable
        case COLORXFORM_HP2 : return new ProcessTransformed<TransformShifted<TransformHp2<USHORT> > >(pvoidOut, Info(), TransformShifted<TransformHp2<USHORT> >(shift)); break;
                                                                                                                                                                         ^
"..\scan.h", line 782: warning #112-D: statement is unreachable
        case COLORXFORM_HP3 : return new ProcessTransformed<TransformShifted<TransformHp3<USHORT> > >(pvoidOut, Info(), TransformShifted<TransformHp3<USHORT> >(shift)); break;
                                                                                                                                                                         ^
1 error detected in the compilation of "../jpegls.cpp".
gmake: *** [jpegls.obj] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****
Developer
Jun 25, 2014 at 10:08 AM
You can try to remove the copy constructor "ProcessTransformed<TRANSFORM>::ProcessTransformed(const
  ProcessTransformed<TRANSFORM> &)" that is causing the problem. It is not used. (I have already removed it from the current code).
Jun 25, 2014 at 4:38 PM
That solved it! Thanks
Developer
Jun 25, 2014 at 9:11 PM
I downloaded the TI compiler and did some experimentation with it.
  • the unreachable warning can be solved by removing the break statement after the return.
  • the shift warning can be solved by defining changing LONG_BITCOUNT = sizeof(LONG)8 into LONG_BITCOUNT = 32. These values should however be identical, so it is strange that the compiler generates this warning. It would recommend to check the actual value of sizeof(LONG)8 (by printing it to a console for example). If sizeof(LONG)*8 is 32 then this is a false warning which you could report to TI.
The TI compiler supports the C++ 03 standard but not the C++ 11 standard (see http://processors.wiki.ti.com/index.php/Overview_of_C%2B%2B_Support_in_TI_Compilers). The "master" branch in the CharLS git repository requires however a C++ 11 compatible compiler. I have created a 1.x-master branch that can be compiled with a C++ 03 compiler.
Jun 26, 2014 at 3:26 PM
Thanks for the solutions!

It looks like on their C6000 hardware, the type long is 40-bits wide but stored in 64-bit wide chunks of memory. This means long is 5 bytes but sizeof(long) will return 8 for the whole size. Could there be other places in the code where it depends on the hardware for definition of memory sizes?

What do you think about the warning on line 102 of context.h? The line that contains static std::vector<signed char> rgtableC; in the CreateTable function.

"..\context.h", line 102: warning #1369-D: static local variables of extern
      inline function are not resolved to single copy. Not ANSI C++
      Compliant
    static std::vector<signed char> rgtableC;
                                    ^
Also, I don’t understand the differences between the branches and trunk. Are the branches updated versions of CharLS 1.0 under the Downloads tab that have not yet been officially released? And if CharLS 1.0 ends up working in CCS should I still download the 1.x-master? Which one was downloaded from the Download tab, C++11 or C++03?
Developer
Jun 27, 2014 at 4:25 PM
It looks like on their C6000 hardware, the type long is 40-bits wide but stored in 64-bit wide chunks of memory. This means long is 5 bytes but sizeof(long) will return 8 for the whole size. Could there be other places in the code where it depends on the hardware for definition of memory sizes?
The data type long is 32 bits on the Windows platform (both in 32 bit and 64 bit mode). You can try to update the typedef to int32_t instead of long for LONG. (int32_t is defined in cstdint or stdint.h
What do you think about the warning on line 102 of context.h? The line that contains static std::vector<signed char> rgtableC; in the CreateTable function.

"..\context.h", line 102: warning #1369-D: static local variables of extern
      inline function are not resolved to single copy. Not ANSI C++
      Compliant
    static std::vector<signed char> rgtableC;
                                    ^

This warning has already been resolved in the 1.x-master source code branch.
Also, I don’t understand the differences between the branches and trunk. Are the branches updated versions of CharLS 1.0 under the Downloads tab that have not yet been officially released? And if CharLS 1.0 ends up working in CCS should I still download the 1.x-master? Which one was downloaded from the Download tab, C++11 or C++03?
The original version control system (VCS) used by CharLS on codeplex was subversion. This VCS uses the folder pattern branches and trunk to maintain the "head"of development and branches. The VCS system was changed to git a couple of months ago. Git is more open-source friendly as it makes it easier for other people to experiment with the source code and to contribute changes. I already clean-up the folder structure for the git 'master' branch a couple of days ago.
The master branch has been updated to leverage C++11 features but is functional equal to the 1.x-branch. I created the 1.x-branch to support platforms for which a C++11 compiler is not yet available.

The source code in the download section is very stable, however making a release requires some more polishing and I didn't have time to do that.

In your case I would recommend to download the latest 1.x-master source code snapshot.