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

Answer by Boffin for How to solve static declaration follows non-static declaration in GCC C code?

$
0
0

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 the bewildering error: "static declaration of ‘savePair’ follows non-static declaration". There was nothing wrong with my definition of function savePair, it was that unclosed bracket.


Viewing all articles
Browse latest Browse all 8


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>