4

When I try to use the /EHs flag in a Compiler Explorer testcase (to "enable" exceptions passing through extern "C" functions), VC++ 19.22 seems to be ignoring it, based on it still kicking out a C5039 and not actually changing the code.

What am I missing? Have I forgotten another switch or something?

  • Base case cmdline: /O1 /EHsc /Wall /wd4571
  • Test case cmdline: /O1 /EHs /Wall /wd4571
Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • SO you've found/fixed the problem … BUT, do you now get different code generated? (The stuff I tried yesterday on your related issue always gave the same generated ASM, no matter what use of /EH I tried.) – Adrian Mole Nov 26 '19 at 12:29
  • @Adrian-ReinstateMonica I haven't fixed the problem yet sadly; I'm not sure there's a way to override that flag, so I've asked Matt whether he can make it conditional or something. FWIW, I was able to prove externally that the approach works ... _but_ I've yet to produce a useful self-contained testcase online. This question was generated by my getting back into that - watch this space :) – Lightness Races in Orbit Nov 26 '19 at 12:30

1 Answers1

4

Ah, looks like Compiler Explorer sets the exception model itself, and this is taking precedence.

Screenshot of the culprit

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055