C6322

Actualización: noviembre 2007

C6322

Advertencia C6322: Bloque empty _except

Este mensaje indica que no hay ningún código en el bloque _except. Como resultado, las excepciones podrían no controlarse.

Ejemplo

El código siguiente genera esta advertencia:

#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)
     {
     }
}

Para corregir esta advertencia, utilice el código siguiente:

#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");   
     }
}  

Vea también

Referencia

try-except Statement