Why C allows multiple global declarations of the same variable but NOT multiple local declarations?

Viewed 58

I noticed that if I declare a global variable multiple times the compiler does not even output a warning.

However if I declare a local variable in a function multiple times the gcc compiler outputs an error and does not compile the file.

What is the explanation for this behavior?

0 Answers
Related