I have a problem with a macro declared on another class to manage the traces.
I try to create another macro for the case when i'm using TEND ((void *) iRet) but it's not working neither ...
class trace.h:
#define TEND(val) DTRACE(XZC_N0, "End - Returned value", val) \
return(val);
class using macro but wrong!:
void *traitReponse( void *pv )
{
INT iRet = XZC_OK;
iRet = inserBDTR(rsltDemande, pchDateRecherche, pchDateDeb, pchDateFin, pchLogin, pchISDN, pchEntite);
TEND ((void *) iRet)
}
Class using macro working fine without warning:
INT bdDisconnectDb ( )
{
INT iRet = XZC_OK;
TBEGIN
if (0 != sqlca.sqlcode)
{
iRet = XZC_NOK;
goto FIN_FONCTION;
}
else
{
TRACE(XZC_N2, "Disconnection successful")
}
FIN_FONCTION :
TEND (iRet)
}
The compilation passed ok but i have these warnings:
In file included from tmp_ProcA.c:263:0:
tmp_ProcA.c: In function 'traitDemande':
tmp_ProcA.c:1514:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
TEND ((void *) (iRet))
^
xzenvir.h:255:12: note: in definition of macro 'TEND'
return(val);
^
In file included from ProcA.c:263:0:
ProcA.c: In function 'traitDemande':
ProcA.c:1514:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
TEND ((void *) (iRet))
^
xzenvir.h:255:12: note: in definition of macro 'TEND'
return(val);
^
In file included from bdconn.h:38:0,
from tmp_ProcB.c:263:
tmp_ProcB.c: In function 'traitReponse':
tmp_ProcB.c:1104:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
TEND ((void *) (iRet))
^
xzenvir.h:255:12: note: in definition of macro 'TEND'
return(val);
^
In file included from bdconn.h:38:0,
from ProcB.c:263:
ProcB.c: In function 'traitReponse':
ProcB.c:1104:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
TEND ((void *) (iRet))
^
xzenvir.h:255:12: note: in definition of macro 'TEND'
return(val);
^
I try to create another macro like this:
#define TEND_PROC((void *) val) DTRACE(XZC_N0, "End - Returned value", val) \
return(val);
but it's not working! can you please help me? Thanks in advance