static declaration of foo follows non-static declaration

Aseem Rastogi aseem@india.tejasnetworks.com
Mon Jun 11 11:20:00 GMT 2007


I doubt the way you are using foo () in your code. I hope you are aware 
that static functions should be used by prefixing them with class name. 
For ex. if class name is A and function is foo, you should write A::foo ().

If you can show some code, it would be better.

-Aseem.

Dhiraj.Nilange@iflexsolutions.com wrote:

>Hi,
>
>During gcc compilation of  C code I am getting these strange errors
>(compile time):-
>
>
>error: static declaration of foo follows non-static declaration
>
>error: previous implicit declaration of foo was here
>
>
>foo is some function here. These errors are surprising, because there is
>only one definition of the function foo. Moreover this code perflectly
>gets compiled using IBM's xlr_c and HP's aCC. So I guess this is gcc
>specific issue. Please help!
>
>Thanks,
>-Dhiraj
>
>





More information about the Gcc-help mailing list