Re: Polyspace Problem



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.

.



Relevant Pages

  • Re: komplexes Problem mit Funktionszeigern
    ... Die Funktion gibt einen struct "by value" zurueck und bei der ... am Borland Compiler, da der Microsoft Compiler ... Man kann Argumente fuer eine Funktion z.B auf dem Stack uebergeben. ... Das funktioniert natuerlich nur fuer "Basis Typen" die in ein Register passen. ...
    (de.comp.lang.c)
  • Re: Naming typedefs
    ... problem that a scalar could be returned in the A register ... to have waste precious cpu cycles copying the struct there ... of the hardware or twentieth century compiler technology. ... # to include the header defining it into every other header (assuming ...
    (comp.unix.programmer)
  • Re: assembly language and reverse engineering
    ... "return arguments to struct pointed to by register" and ... assumptions of CDECL-like conventions (also supports STDCALL, ... arg for handling struct return (slightly compiler, and compiler version, ...
    (alt.lang.asm)
  • Re: HardBound and SoftBound (was "The State of Software")
    ... I will explain to you one last time that the problem is not whether a compiler can generate checks for all buffer overflows. ... By the way, in the last example of such code that I saw, it had been changed to use the address of the struct, not of the first element of the struct: ... to take address of struct rather than address of first element. ... such tricks are used to create a pointer which is then passed on. ...
    (comp.arch)
  • Re: List<> of struct with property. Cannot change value of property. why?
    ... method changes the struct that owns it. ... how would the compiler know the method changes the struct? ... Should the linker be required to carry this flag around too, so that when you import a reference to a struct type not compiled with the current project, you still have that information? ... There's a time and place for a value type, and in fact they even have their place in lists. ...
    (microsoft.public.dotnet.languages.csharp)