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.

Compiler error in yvals.h and Xutility.h

Hi All,

          I had a compilation error [originating out of this folder related files  <TI INSTALLATION PATH>\ccsv5\tools\compiler\c6000_7.4.1\include].

There are two files in that folder

yvals.h

Xutility.h

1.both of them have definitions for _MAX , _MIN

yvals.h

#define _MAX max
#define _MIN min

Xutility.h

#ifndef _MAX /* avoid collision with common (nonconforming) macros */
#define _MAX (max)
#define _MIN (min)
#endif /* _IS_IBM */

looks like in one of the Ti folder or by virtue of my API Calls, the header file called is in order [yvals.h and then Xutility.h is called]

since _MAX is already defined in yvals.h, the definition of _MAX coming out of Xuliity.h does not get applied

If you look closely in Xutility.h, there are many calls on _MAX

// TEMPLATE FUNCTION max
template<class _Ty> inline
const _Ty& _MAX(const _Ty& _Left, const _Ty& _Right)
{ // return larger of _Left and _Right
return (_DEBUG_LT(_Left, _Right) ? _Right : _Left);
}

// TEMPLATE FUNCTION max WITH PRED
template<class _Ty,
class _Pr> inline
const _Ty& _MAX(const _Ty& _Left, const _Ty& _Right, _Pr _Pred)
{ // return larger of _Left and _Right using _Pred
return (_DEBUG_LT_PRED(_Pred, _Left, _Right) ? _Right : _Left);
}

2. Having said everything on step 1, i used to get this error

 too many arguments in macro invocation

3. From [my friend debugged it] understanding, what i conclude is below way is wrong/incorrect in yvals.h

#define _MAX max
#define _MIN min

it has to be [correct way]

#define _MAX (max)
#define _MIN (min)

4. After doing the above correction, all the errors got solved and the build was successfull.

My questions to Ti

1. Has this issue been found or reported. Is it being fixed or to be fixed [tracked as of Ti Software Bug Tracking System].

2. I am sure that this is 100% compiler error, is there any understanding missing on my part, let me know.

3. how a parentheses/bracket is making a difference in successful building of the code.

please let me know more on this.

Thanks

RC Reddy

  • Neither yvals.h nor xutilty are meant to be included directly.  How are you encountering this error?  What standard include files are you using, in which order?

  • Hi,

         Thanks for your reply. I get the error as put below. 

    "/<my_your_path>/ti/TI_CGT_C6000_7.4.1/include/xutility", line 1779: error #41: expected an identifier
    "/<my_your_path>/ti/TI_CGT_C6000_7.4.1/include/xutility", line 1787: error #56: too many arguments in macro invocation
    "/<my_your_path>/ti/TI_CGT_C6000_7.4.1/include/xutility", line 1802: error #56: too many arguments in macro invocation
    "/<my_your_path>/ti/TI_CGT_C6000_7.4.1/include/xutility", line 1807: warning #12-D: parsing restarts here after previous syntax error
    "/<my_your_path>/ti/TI_CGT_C6000_7.4.1/include/xutility", line 1807: error #66: expected a ";"

    These errors i am seeing in different manifestations in different files. Overall the same code is compiled properly on CCS,whereas it is running into error on linux build. I strongly see the need of parentheses in #define. Again, i am not sure how it is helping.

    after debugging, suspect below lines could be causing the issue.

    #include <xdc/std.h>
    #include <c6x.h>

    Thanks

    RC Reddy

  • What version of XDC are you using?

    What is your complete compiler command line?  You can find this in the build console.

  • xdctools_3_23_03_53/package

    i could not get what you mean by this statement "What is your complete compiler command line". Is it the below information what you asked for?

    <>/ti/TI_CGT_C6000_7.4.1/bin/cl6x"

    Thanks

    RC Reddy

  • No, I need the compiler options.  The complete compiler command line will look something like this:

    C:\ti\ccsv5\tools\compiler\c6000_7.4.1\bin\cl6x -o2 -ms -s -g -Dvar=456 -I C:\ti\ccsv5\some\where -I C:\ti\csv5\some\where\else file.c

  • Hi,

        citing confidential reasons, i may not be able to post any compiler command line to forum directly. Is it possible for you to share your Ti email id [or i will connect to you on Ti e2e ADD user and then use send message option], so that i can communicate on the email. Sorry again, i need help, but at the sametime, i am tied to confidentiality agreement, hence cant post/paste [request you to kindly understand].

    Thanks

    RC Reddy

  • You can send me a private message by clicking on the "start conversation" button on my profile page.

  • Hi,

        I don't see any button there. I sent friend invite request, kindly add me so that i can send you the compiler comand line.

    Thanks

    RC Reddy