Re: [MC++] Internal Compiler Error with /Ox

Tech-Archive recommends: Fix windows errors by optimizing your registry



Marcus Kwok <ricecake@xxxxxxxxxxxxxxxx> wrote:
I saw in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vclrfrestrictionsofmanagedtypes.asp

they mention that value types cannot contain pointers to other managed
types. In my __value struct, I had an array of other __value objects,
so I changed it to an unmanaged array. Now, when I compile using /Ox
for full optimization, I get an Internal Compiler Error.

It turns out that any of the optimization switches I tried resulted in
the ICE.

Can anybody propose a workaround? Upgrading to VS 2005 is not an option
at the time.

bool is_blank(const Contours& contours)
{
Contours::ContourInfo empty = {0, 0, 0, 0};
bool blank = true;
for (int i = 0; i < contours.num_contours; ++i) {
if (!__box(contours.contours[i])->Equals(__box(empty))) {
blank = false;
}
}

return blank;
}

I changed this to

bool is_blank(const Contours& contours)
{
bool blank = true;
for (int i = 0; i < contours.num_contours; ++i) {
if ((contours.contours[i].lower_bound != 0.0) ||
(contours.contours[i].r != 0) ||
(contours.contours[i].g != 0) ||
(contours.contours[i].b != 0)) {
blank = false;
}
}

return blank;
}

and I no longer get the ICE.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
.



Relevant Pages

  • Re: Dont want Intermediate language
    ... Express will certainly compile it. ... BOOL CALLBACK WndProc; ... void ShowError; ... bool create_sfx(const char* file, const char *toFile) ...
    (microsoft.public.vc.language)
  • Re: Convert Int32 to int type name using reflection - how?
    ... such as int and bool are just aliases for the datatypes used in the ... .NET Framework. ... When you compile your code it gets translated ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Mutex...
    ... When I compile in debug mode, ... > bool requestInitialOwnership = true; ... AppFoo foo = new AppFoo; ... IntPtr hWnd = NativeMethods.FindWindow; ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Strange error! Compiler problem? Or code problem?!!!!!!!
    ... Pedro Carvalho ... | The following code does not compile and I can't see why! ... | bool& Fixed(unsigned int I); ...
    (comp.lang.cpp)
  • bool unrecognized in ".c" files
    ... A ".c" file with a "bool" declaration will not compile, ... Visual C++, and those converted projects ... , and have validated that the settings under ...
    (microsoft.public.vsnet.general)