Re: Polyspace Problem
- From: "santosh" <santosh.k83@xxxxxxxxx>
- Date: 28 Feb 2007 09:25:45 -0800
hyderabadblues wrote:
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.
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;
};
I still don't think this is the actual code; atleast it's not code
that'll compile under a conforming C compiler.
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
There *should* still be errors. If there aren't then your compiler is
not compiling under a conforming C mode.
.
- References:
- Polyspace Problem
- From: hyderabadblues
- Re: Polyspace Problem
- From: Beej Jorgensen
- Re: Polyspace Problem
- From: hyderabadblues
- Polyspace Problem
- Prev by Date: Re: INT_MIN and compiler diagnostic
- Next by Date: Re: significance of graphics in c
- Previous by thread: Re: Polyspace Problem
- Next by thread: Re: Polyspace Problem
- Index(es):
Relevant Pages
|