By default gcc compiles code with its own "dialect" which is an extension of C89. It is probably a good idea for new code and especially anybody learning C nowadays to pass to more modern and standardized version of the language. Unfortunately their implementation of C11 isn't yet complete, so you'd have to stick with C99 for the moment using -std=c99
.
The gcc online documentation has information on the different dialects of C they implement.
An alternative compiler could be clang which is C99 by default. To my experience it is often better suited for beginners because the diagnostics are a bit more user friendly than gcc's.