Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Compiler error in yvals.h and Xutility.h

$
0
0

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


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>