Re: Polyspace Problem



hyderabadblues <sirishkumar@xxxxxxxxx> wrote:
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;
};

Why would you make a typedef part of structure? That looks rather
strange, to say the least, and definitely nothing I would assume
a compiler to let me get away with. And even if that would be
possible why would you give all three the same name ('_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

You either have totally confused your compiler or you're not
posting your real code.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.



Relevant Pages

  • Re: [PATCH 1/1] LinuxPPS: Pulse per Second support for Linux
    ... Follows my comments and then the patch, hope now I can came back into ... +typedef union pps_timeu { ... +typedef struct pps_info { ... different version of the compiler, and when different compiler options are ...
    (Linux-Kernel)
  • 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: structs help
    ... >same name and the second compiler didn't like it. ... As I like to point out, the real problem with typedef is that it ... This is even more pronounced in the "typedef struct ..." ... time, though, I expect any programmer working on the zorgle program ...
    (comp.lang.c)
  • Re: C90 penetration
    ... If we agree on a set of digits that includes all Latin 1 alpha, ... if 'double' were indeed a typedef for a struct ... And there are a number of other reasons why making "double" a typedef ... for a struct type would make a compiler non-conforming. ...
    (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)