Re: Polyspace Problem



On Feb 28, 9:44 am, "hyderabadblues" <sirishku...@xxxxxxxxx> wrote:
Hi,

I am using polyspace tool.

That's irrelevant, I think, and making that part of your subject makes
it less likely that people will respond. Your problem is simply a C
language issue.

When I compile the following code I am getting the error as
__true_type undefined

This is because you haven't defined a type called "__true_type".

struct __true_type{

};

Here you've defined a structure type called "__true_type". (BTW, I
have a feeling that using "__" as the start of an identifier is
against the standard. That namespace is, I think, reserved for
implementors).


struct __type_traits{

typedef __true_type _h;

Here you're trying to define that "_h" (again a leading "_" is not
recommended, I seem to recall) is a way of referring to the data type
"__true_type" which you haven't defined.


};

Can anybody help me regarding this

I'm not totally sure what you are trying to achieve here, so it's not
easy.

I suspect you need to reread your reference books to understand what
typedef does and what it's for.

One approach to what I think you are trying to do would be :-

typedef struct __true_type true_type_t;
struct __true_type{

};

struct __type_traits{

true_type_t _h;

};

.



Relevant Pages