C6322
C6322 Uyarı: boş _except bloğu
Bu ileti _except bloğunda kodu yok olduğunu gösterir.Sonuç olarak, özel durumlar, işlenmemiş geçebilir.
Örnek
Aşağıdaki kod, bu uyarı oluşturur:
#include <stdio.h>
#include <excpt.h>
#include <windows.h>
void fd(char *pch)
{
__try
{
// exception rasied if pch is null
*pch= 0 ;
}
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
{
}
}
Bu uyarı düzeltmek için şu kodu kullanın:
#include <stdio.h>
#include <excpt.h>
#include <windows.h>
void f(char *pch)
{
__try
{
// exception rasied if pch is null
*pch= 0 ;
}
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
{
// code to handle exception
puts("Exception Occurred");
}
}