Re: Polyspace Problem



On Feb 28, 8:55 pm, Keith Thompson <k...@xxxxxxx> wrote:
"hyderabadblues" <sirishku...@xxxxxxxxx> writes:
When I compile the following code I am getting the error as
__true_type undefined

struct __true_type{
};

struct __type_traits{

typedef __true_type _h;
};

Get rid of the leading underscores. Identifiers starting with an
underscore are reserved to the implementation. Some are reserved for
all purposes, others only at file scope; it's easier to avoid leading
underscores altogether than to remember the detailed rules.

A declaration:

struct foo { /* ... */ };

creates a type called "struct foo". You can't refer to it as just
"foo". <OT>C++ does let you refer to it as "foo"; make sure your
compiler is being invoked as a C compiler so it catches these
errors.</OT>
<OT>Actually, OP's compiler must be a C++ compiler, since typedef-
within-a-struct seems to be legal in C++. An example from working
draft ISO:
struct X {
typedef int T;
static T count;
void f(T);
};
void X::f(T t = count ) { }
</OT>
--
WYCIWYG - what you C is what you get

.



Relevant Pages

  • Re: Professional programmers coding conventions for Fortran
    ... pretty common typos is to capitalize the first 2 letters of a ... Underscores also need the shift key, ... mandate that the compiler acccept both cases. ... Before f90, ...
    (comp.lang.fortran)
  • Re: underscore names
    ... Not to mention that it may have fixed or prevented a possibly nasty bug. ... What will happen is that some compiler will choke on the leading ... underscores, but you will be able to coax it into compiling by ... specifying --stripped_export or something to the linker. ...
    (comp.lang.c)
  • Re: From D
    ... inside number literals, like 1_000_000, the compiler doesn't enforce the ... position of such underscores, so you can also put them like this: ... visual systems can't count/group them quickly. ...
    (comp.lang.python)
  • Re: struct problem
    ... All identifiers beginning with two underscores, ... that mainbe defined with a return type of int. ... and using a compiler that does not conform to either ... language standard. ...
    (comp.lang.cpp)
  • implementor vs standard, was: anti-aliasing
    ... The double-underscore sequence is reserved for the ... IMnaaHO, they should have kept the underscores and added a new header, ... non-standard new keywords to interfere with the programmer's existing, ... the compiler proper, ...
    (comp.lang.c)