industrialNETworXnetx

ihd

ihd

| 16.12.2008 | 10:38 | 2 replies

void* assigns to itself?

hi, i just studied the code of the provided RTE example for the netStick and found a confusing statement.

in the file "ShmDemo_Resources.c",
line 119,
in the function "TaskResource_ShmDemo_InitLocal"

 
  TLR_RESULT TaskResource_ShmDemo_InitLocal(SHM_DEMO_RSC_T* ptRsc, void* pvInit)
  {
     /* initialize */
     (pvInit = pvInit);
     ....
  }

i'm not new to C, but my eyes didn't see something like that before.
what is the purpose of this statement?

greez, harry

M T

M T

Hilscher Gesellschaft für Systemautomation mbH

| 16.12.2008 | 11:18

I think you've seen UNREFERENCED_PARAMETER(a) in standard C (Commonly used under Windows) before.

a = a; is the same. It avoids compiler warnings about unreferenced parameters.

Regards

MT

ihd

ihd

| 16.12.2008 | 13:29

alright,
thank you very much.

Login