Compiler error... w/ _try & _except

The above code wont compile:

int main(void) {
	_try
	{
		return 1;
	}
	_except(1) {
		return 0;
	}
}

why?

yannick> pgcpp -c shouldcompile.cpp
PGCC-S-0000-Internal compiler error. gen_statements: bad statement kind 0
(shouldcompile.cpp: 2)
PGCC/x86 Windows 8.0-5: compilation completed with severe errors

Ummm… Compiled with IntelCC and MSCC successfully…
Is it a bug!?

Thank you!

Yannick

Oh and BTW guys you should really fix these annoying compile warnings in Microsoft Open Tools 9 includes, just add preproc directives…

Hi Yannick,

_try _except and _try _finally are Microsoft extensions that we do not yet support. Though, we should be giving a better error message. I’ll file a technical problem report for message and a feature request for the extensions.

  • Mat

While these extensions aren’t yet supported, as of the 8.0-6, the compiler will give a better error message:

PGI$ pgcpp -c test.cpp
PGCC-S-0155-unsupported microsoft extension: try-except,try-finally (test.cpp:2)
PGCC/x86-64 Windows 8.0-6: compilation completed with severe errors
  • Mat