tags:

views:

161

answers:

4

Hi,

I am trying to build a block where I am getting this error message

pprbc_CONTENT_icverification_act.c", line 99.2: 1506-018 (S) Operand of indirection operator must be a pointer expression

Can anyone please explain what this means?

code below:

   *(WORK_migration_ind_f) =
   *(migration_status_in_MI9_CIRCLE_INFO(WORK_source_circle_f));
+5  A: 

Yes, you put a '*' in front of something that isn't a pointer.

You'd be doing yourself and everybody a favor if you posted the line of code involved.

Carl Smotricz
solved it. the function `migration_status_in_MI9_CIRCLE_INFO(WORK_source_circle_f)`returns a char pointer. but that header file should be included some where deep below in the core of the application which was missing. so since the header was not included compiler was assuming that the function will return an inetger resulting the error above. thanks a lot for all your advices:)
Vijay Sarathi
+1  A: 

Presumably you have code something like this:

int x;

*x;    // apply indirection to non-poiner

But it's impossible to say without seeing the actual code that causes the error message.

anon
+1  A: 

The * (indirection) operator dereferences a pointer; that is, it converts a pointer value to an l-value. The operand of the indirection operator must be a pointer to a type.

Gregory Pakosz
+1  A: 

Either the variable WORK_migration_ind_f or the return type of the function migration_status_in_MI9_CIRCLE_INFO (or both) is not a pointer type. You can dereference only a pointer.

If you have code like:

int *pi;
int i;
int f(void);
int *pf(void);

Then, the following "makes sense":

*pi /* is of type int */
*pf() /* is of type int */

The following doesn't:

*i /* can't dereference a non-pointer */
*f() /* can't dereference a non-pointer */

If you show us the declarations of WORK_migration_ind_f and WORK_migration_ind_f, we can tell you more, but I think you should be able to figure the error out on your own now.

Alok