Re: Polyspace Problem
- From: "hyderabadblues" <sirishkumar@xxxxxxxxx>
- Date: 28 Feb 2007 02:44:11 -0800
On Feb 28, 11:33 am, Beej Jorgensen <b...@xxxxxxx> wrote:
hyderabadblues <sirishku...@xxxxxxxxx> wrote:
__true_type undefined
__true_type isn't defined. The full name of the type is "struct
__true_type":
struct __true_type{
};
I don't know what your intent is here:
struct __type_traits{
typedef __true_type _h; [<-- this is where the error is!]
};
If you're trying to declare a field _h in struct __type_traits, then the
proper syntax would be:
struct __type_traits {
struct __true_type _h;
};
But if you're trying to typedef _h as a synonym for struct __true_type,
you can't do that inside the struct. Moving it outside the struct, the
syntax would be:
typedef struct __true_type _h;
On top of all that, I believe identifiers with two leading underscores
(even as struct names) are reserved (c99 7.1.3p1). And that last _h
typedef probably violates the same section if it's at file scope.
Someone should probably confirm or deny this, since I'm not entirely
sure on it.
-Beej
Problem is solved when I put struct after typedef...
But actual code looks comething like this
struct __true_type{
};
struct __false_type{
};
struct __state_type{
};
struct __type_traits{
typedef __true_type _h;
typedef __false_type _h;
typedef __state_type _h;
};
When I compiled the above code I got three errors,
__true_type isn't defined
__false_type isn't defined
__state_type isn't defined
but after changing the code to
struct __type_traits{
typedef struct __true_type _h;
typedef __false_type _h;
typedef __state_type _h;
};
There are no errors. Why is this
.
- Follow-Ups:
- Re: Polyspace Problem
- From: santosh
- Re: Polyspace Problem
- From: Jens Thoms Toerring
- Re: Polyspace Problem
- From: Beej Jorgensen
- Re: Polyspace Problem
- References:
- Polyspace Problem
- From: hyderabadblues
- Re: Polyspace Problem
- From: Beej Jorgensen
- Polyspace Problem
- Prev by Date: Re: Polyspace Problem
- Next by Date: Re: INT_MIN and compiler diagnostic
- Previous by thread: Re: Polyspace Problem
- Next by thread: Re: Polyspace Problem
- Index(es):
Relevant Pages
|