Quantcast
Channel: How to solve static declaration follows non-static declaration in GCC C code? - Stack Overflow
Browsing all 8 articles
Browse latest View live

Answer by Nnaik for How to solve static declaration follows non-static...

I had a similar issue , The function name i was using matched one of the inbuilt functions declared in one of the header files that i included in the program.Reading through the compiler error message...

View Article



Answer by Boffin for How to solve static declaration follows non-static...

This error can be caused by an unclosed set of brackets. int main { doSomething {} doSomething else { } Not so easy to spot, even in this 4 line example. This error, in a 150 line main function, caused...

View Article

Answer by raggot for How to solve static declaration follows non-static...

I have had this issue in a case where the static function was called before it was declared. Moving the function declaration to anywhere above the call solved my problem.

View Article

Answer by RotatingWheel for How to solve static declaration follows...

You have declared a function as non static in some file and you have implemented as static in another file or somewhere ion the same file can cause this problem also. For example the following code...

View Article

Answer by hlovdal for How to solve static declaration follows non-static...

From what the error message complains about, it sounds like you should rather try to fix the source code. The compiler complains about difference in declaration, similar to for instance void foo(int...

View Article


Answer by bjg for How to solve static declaration follows non-static...

While gcc 3.2.3 was more forgiving of the issue, gcc 4.1.2 is highlighting a potentially serious issue for the linking of your program later. Rather then trying to suppress the error you should make...

View Article

Answer by el.pescado for How to solve static declaration follows non-static...

Try -Wno-traditional. But better, add declarations for your static functions: static void foo (void); // ... somewhere in code foo (); static void foo () { // do sth }

View Article

How to solve static declaration follows non-static declaration in GCC C code?

I'm trying to compile the same C file on two different machines with different versions of cc. gcc version 3.2.3 says warning: 'foo' was declared implicitly 'extern' and later 'static' gcc version...

View Article

Browsing all 8 articles
Browse latest View live




Latest Images