parameters "c style" in a C++ constructor (use of __attribute__)

T

timor.super

Hi all,
in a .c file, i'm using a var :

const unsigned char myVar[8] __attribute__ ((aligned (4))) = {1, 2, 2,
1, 2, 2, 2};

this var is used by a C function : myCFunction(myVar) ...

this is working ...

but now, I want to make a class using this C function, i'm doing :

class MyClass
{
MyClass(const unsigned char *);
};

MyClass::MyClass(const unsigned char *c)
{
myCFunction(c);
}

this is compiling, but the function doesn't make the good effect,
probably due to the __attribute__ ((aligned (4))) .

If I don't use the __attribute__ ((aligned (4))) in the .c file, the
function is still working, but I shouldn't modify the .c file, how can
I do to make it working ?

Thanks for your help

Best regards

S.
 
I

Ian Collins

Hi all,
in a .c file, i'm using a var :

const unsigned char myVar[8] __attribute__ ((aligned (4))) = {1, 2, 2,
1, 2, 2, 2};
That's all rather non-standard, better to ask in a compiler specific group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top