cstructparametersarguments

C Structs--error: parameter name omitted


I am receiving the following error for the following code:

kernel/proc.c: In function ‘getpinfo’:
kernel/proc.c:495: error: parameter name omitted

The code is as follows:

int 
getpinfo(struct pstat *)
{
}

Can you please tell me what I am missing about the struct or the code?


Solution

  •      int 
         getpinfo(struct pstat *)   
          {
          }
    

    Did not given any parameter Name.

    Function definition should contain List of parameters, with valid type and parameters names.where as in declarations parameter Names are optional

    This should be

         int 
         getpinfo(struct pstat *some_name)
           {
           }