Guru-level question on pure managed C++

K

Kalafiorczyk

Good day ladies and gentlemen!

I have a short proggie:
-----------------------------------------------------------------------
#using <mscorlib.dll>
using namespace System::Security::permissions;
[assembly:SecurityPermissionAttribute(
SecurityAction::RequestMinimum,SkipVerification=false)];
using namespace System;
int main()
{
#if SSSS
Console::WriteLine(S"Hello,managed world!");
#else
int i(0);
#endif
return 0;
}
-----------------------------------------------------------------------
which, when compiled as follows:

cl /clr:initialAppDomain /Od /DSSSS=1 prog.cpp nochkclr.obj /link /entry:main /fixed:no /opt:ref
silo -s prog.exe
peverify prog.exe

produces a pure executable assembly. When SSSS=0 it creates an
working executable assembly that doesn't pass the purity test:

[IL]: Error: Unverifiable PE Header/native stub.

I've tried using "Int32" instead of "int" with no joy.

My question to the gurus is: what is the appropriate integer
type to use that will not destroy the purity of a .NET assembly?

I know that I should probably just wait for the 2004 release
of Visual Studio, but I like to hear the opinion of the gurus
about the current state of the art in purity of managed C++.

Thanks in advance,

Sylvester
 
K

Kalafiorczyk

Hello George!

George Ter-Saakov said:
So when SSSS = 1 you have "Hello,managed world!" in data section.
With SSSS = 0 it's empty.

Thanks, but this is not it. You can remove all conditional
compilation directives, have one String * and one int and the
peverify will still complain.

Regards,

Sylvester
 

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

Top