Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the purpose of the following about UNREFERENCED_PARAMETER?

Tags:

windows

winapi

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)

UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

what's the purpose of UNREFERENCED_PARAMETER here?

like image 562
Adam Lee Avatar asked Jun 27 '12 14:06

Adam Lee


1 Answers

It just suppresses a compiler warning about two parameters being unused in the function.

The macro itself is probably just defined as

#define UNREFERENCED_PARAMETER(x) (x)

so it references its argument but does nothing with it.

like image 193
Joey Avatar answered Nov 15 '22 11:11

Joey