NO

Author Topic: [Solved] Error getting ptr on variable inside exception filter with -Ot/-Os/-Ox  (Read 2920 times)

iZzz32

  • Guest
Maybe I've already reported it, but anyway… POCC 6.00.6 fails to compile the following code:
Code: [Select]
#include <windows.h>
#include <stdio.h>

DWORD exception_filter(int* k)
{
  return EXCEPTION_EXECUTE_HANDLER;
}

int main(void)
{
  int               foo;
  int *             bar;

  // bar = &foo;

  __try
  {
    *(DWORD *) 0 = 0xdeadbeef;
  }
  __except(exception_filter(&foo))
  {
    printf("Exception!\n");
  }
  return 0;
}
C:\>pocc -Ze -Ot test.c says:
Code: [Select]
test.c(12): warning #2114: Local 'bar' is not referenced.
test.c(19): error #3151: [asm] Syntax error.
test.c(19): error #3152: [asm] Expected ')'.
test.c(19): error #3152: [asm] Expected ']'.
test.c(19): error #3151: [asm] Syntax error.
It compiles when I uncomment an assignment to bar or without -Ot/-Os/-Ox. IIRC, the same code compiles without errors in 4.50 (with and without optimizations) too.
« Last Edit: October 31, 2010, 07:23:31 PM by iZzz32 »