Re: Polyspace Problem



hyderabadblues <sirishkumar@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

.



Relevant Pages

  • Re: Polyspace Problem
    ... proper syntax would be: ... you can't do that inside the struct. ... that'll compile under a conforming C compiler. ...
    (comp.lang.c)
  • Re: Polyspace Problem
    ... I don't know what your intent is here: ... proper syntax would be: ... you can't do that inside the struct. ... Moving it outside the struct, ...
    (comp.lang.c)
  • [3/9] Lustre VFS patches for 2.6
    ... This patch adds intent opertion and intent release callback to ... struct open_intent, so that interested code ... extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); ...
    (Linux-Kernel)
  • Re: Read binary data file
    ... pointless stupid act. ... A C struct at least gives you an idea as to what type of data is in ... original intent of the data was for internal use only - and that is often ... Data needs to read from a file in Java. ...
    (comp.lang.java.programmer)
  • Re: Read binary data file
    ... A C struct is not a suitable, ... format "definition" has no fucking clue what he is doing. ... original intent of the data was for internal use only - and that is often ... Creating unecessary ICDs is a bad thing. ...
    (comp.lang.java.programmer)