Hi all,

I use SD_API_SUCCESS in my function like this :
"
SD_API_STATUS My_function (para,.....)
{
SD_API_STATUS RequestStatus;
......
......
if (!SD_API_SUCCESS(RequestStatus)){
return RequestStatus;
}
}
"
When I build my driver, system report :

error C2220: warning treated as error - no 'object' file generated
: [01:0000000036:WARNN ] d:\wince500\public\common\oak\drivers\sds\xxxx.cpp(
warning C4715: 'My_function': not all control paths return a value

I also found that if I comment the SD_API_SUCCESS function and let
My_function return RequestStatus directly, like this :
"
SD_API_STATUS My_function (para,.....)
{
SD_API_STATUS RequestStatus;
......
......
return RequestStatus;
}
"
then, it can be build successfully.

Do you know what's the matter in My_function ? Thanks for your help.

Re: Compile SD_API_SUCCESS function with error. by voidcoder

voidcoder
Fri May 12 08:36:50 CDT 2006

SD_API_STATUS My_function (para,.....)
{
SD_API_STATUS RequestStatus;
......
......
if (!SD_API_SUCCESS(RequestStatus)){
return RequestStatus;
}


<<<< You forgot to return the appropriate result here <<<<

return SomeResult;
}



"xuhaoz" <xuhaoz@discussions.microsoft.com> wrote in message news:D3BBD968-56B2-45C5-97E5-956D8DFF37C5@microsoft.com...
> Hi all,
>
> I use SD_API_SUCCESS in my function like this :
> "
> SD_API_STATUS My_function (para,.....)
> {
> SD_API_STATUS RequestStatus;
> ......
> ......
> if (!SD_API_SUCCESS(RequestStatus)){
> return RequestStatus;
> }
> }
> "
> When I build my driver, system report :
>
> error C2220: warning treated as error - no 'object' file generated
> : [01:0000000036:WARNN ] d:\wince500\public\common\oak\drivers\sds\xxxx.cpp(
> warning C4715: 'My_function': not all control paths return a value
>
> I also found that if I comment the SD_API_SUCCESS function and let
> My_function return RequestStatus directly, like this :
> "
> SD_API_STATUS My_function (para,.....)
> {
> SD_API_STATUS RequestStatus;
> ......
> ......
> return RequestStatus;
> }
> "
> then, it can be build successfully.
>
> Do you know what's the matter in My_function ? Thanks for your help.
>
>