Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error C3839

Error Message

cannot change alignment in a managed type

Alignment of variables is controlled by the common language runtime and cannot be modified with align.

The following sample generates C3839:

// C3839a.cpp
// compile with: /clr
ref class C
{
public:
   __declspec(align(32)) int m_j; // C3839
};

int main()
{
}

The following sample generates C3839:

// C3839b.cpp
// compile with: /clr:oldSyntax
#using <mscorlib.dll>

__gc class C
{
public:
   __declspec(align(32)) int m_j; // C3839
};

int main()
{
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.