← Back to team overview

leaningtech-dev team mailing list archive

[Bug 1393017] Re: error:Field not supported in union.

 

About memory pools: yes you should disable them

In general, to be successfully compiled by Cheerp code must be more type
safe than usual. The Cheerp compiler is already able to report errors
and warning to help you find out some possible issues at compile time,
but this is, of course, not perfect and and the moment it won't be able
to find the problem in the code you posted. Cheerp has been already used
to port very large existing code bases to the Web (~1 millions lines of
C++ code), so we believe that, although there is a lot of room for
improvements, it is suitable to port an existing project.

It would not be hard to fix this code, for example you could take
advantage of anonymous structures inside unions, like this:

union A
{
    struct
    {
        int a;
        int b;
        int c;
     };
     int v[3];
};

    A test;
    test.a = 123;
    test.b = 145;
    test.c = 456;
    int* _convert = test.v;

    _convert[0] = 333;//ok
    _convert[1] = 444;//ok

   char buffer[128];
   sprintf(buffer , "a %d , b %d , c %d" , test.a,test.b,test.c);

-- 
You received this bug notification because you are a member of
Leaningtech Team, which is subscribed to Cheerp.
https://bugs.launchpad.net/bugs/1393017

Title:
  error:Field not supported in union.

Status in Cheerp: C++ for the Web:
  Invalid

Bug description:
  is the error means, cheerp does not support union?

To manage notifications about this bug go to:
https://bugs.launchpad.net/cheerp/+bug/1393017/+subscriptions


References