Re: Polyspace Problem



On 28 Feb, 10:17, "hyderabadblues" <sirishku...@xxxxxxxxx> wrote:
On Feb 28, 10:58 am, mark_blue...@xxxxxxxxx wrote:



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;

};

Actually the code is a extract of STL that is designed by us.I have
modified it to make it easy.

In other words, you're not showing us the code that's really relevant?

But the same code does not give any error in VC++ compiler

What language do you _think_ you are coding in? C? C++? Some peculiar
hybrid/mongrel supported by a particular compiler?

I know too little of C++ to comment on that, but any conforming C
compiler should, as far as I can tell, reject your code.

.



Relevant Pages

  • Re: Is C99 the final C? (some suggestions)
    ... > that someone will try compile their stuff on an old compiler. ... > because the ANSI standard obsoleted them, and everyone picked up the ANSI ... fixed by using another language. ... >>are multiplying two expressions of the widest type supported by your ...
    (comp.lang.c)
  • Re: Forth Frustrations
    ... How would they even know what they are without being language lawyers? ... standard systems and a large number of nonstandard ones. ... interpreter, ... They set up four states -- HOST INTERPRETER COMPILER ...
    (comp.lang.forth)
  • Re: Forth Frustrations
    ... How would they even know what they are without being language lawyers? ... Then if you choose a standard system you can write code for it, ... interpreter, ... They set up four states -- HOST INTERPRETER COMPILER ...
    (comp.lang.forth)
  • Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... > the standard language. ... Or did they just implemented some 80% of the new features? ... there was a fully compiant C compiler available. ...
    (comp.lang.cpp)
  • Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... > the standard language. ... Or did they just implemented some 80% of the new features? ... there was a fully compiant C compiler available. ...
    (comp.lang.ada)