This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Preprocessor #define bug found in C674x DSPLIB v3.4.0.0

Relatively minor, but produces many compiler warnings...

Both ti/dsplib/src/DSPF_sp_blk_move/DSPF_sb_blk_move.h and ti/dsplib/src/DSPF_sp_blk_move/c674/DSPF_sp_blk_move.h define DSPF_sp_BLK_MOVE_H_. Because of this, DSPF_sp_blk_move() never gets declared, and so we get an implicit declaration warning every time this function is used.

  • Hi Darren Warner,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages. Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics.

    Yes, sometimes, it is very unlikely that we will come across an uncovered a warning or bug in the TI packages.

    As long as we know how to fix the warning, there wont be any issues.we can go forward.

    First check whether those header files  ( which has its declarations ) are included in your project. 

    Second, if it is not declared, declare it and check whether the warnings goes off.

    ( As I do not have that particular version of dsplib installed, not able to see the header file how that function is declared. )

  • Hi,

    May be, kindly check the below e2e post whether it could help on your issue:

    https://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/59263

    Thanks & regards,

    Sivaraj K

    ----------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    ----------------------------------------------------------------------------------------------------------

  • You are right.  This is actually little funny. I assume you looked at the two files

    So you understand why it was done this way.  The idea is that for C674 the user will link this include file, and possibly for other devices there will be a different tag, perhaps DSPF_sp_BLK_MOVE_H_ 2 or DSPF_sp_BLK_MOVE_H_ 3

    So the right thing to do is to drop the _1 from the "master" include file

    I will submit IR to fix this issue

    Ran

  • I looked again and I noticed that I was wrong. The #define does not have the _1

    So I do not understand why you got the error. My guess, may be the path to the packages was not defined?

    What do you think?

    Ran
  • Ran,

    Take a look at both the files I mentioned above (in the DSPF_sp_blk_move directory and the DSPF_sp_blk_move/c674 directory) - both preprocessor definitions do not have a _1, hence one clobbers the other.

    -Darren

  • Look at the first file

    #ifndef DSPF_sp_BLK_MOVE_H_   //   it checks only if DSPF_sp_BLK_MOVE_H_    is defined  but

    #define DSPF_sp_BLK_MOVE_H_ 1    // it defined the same one with one, namely DSPF_sp_BLK_MOVE_H_1   so now the only symbol that is defined is  DSPF_sp_BLK_MOVE_H_1      

    #if defined(_TMS320C6740)

    #include <ti/dsplib/src/DSPF_sp_blk_move/c674/DSPF_sp_blk_move.h>

    #else

    #error invalid target

    #endif

    Now look at the second file  - 

    #ifndef DSPF_sp_BLK_MOVE_H_    //    But this is not defined yet, only DSPF_sp_BLK_MOVE_H_ 1 was defined and is defined again here
    #define DSPF_sp_BLK_MOVE_H_ 1

    Do I miss anything?

    Ran

  • Yes - there is a space between DSPF_sp_BLK_MOVE_H_ and 1, so your statement in the second file is incorrect, DSPF_sp_BLK_MOVE_H_ is indeed defined (as 1)
  • You are right, I have not notice this

    The space must be added when they port the code from a different media. I return back to my previous posting and I will submitted IR

    Thank you so much for pointing it out for me. IT is not easy to see

    Can you close the thread

    Ran