If a source file name ends in one of the following extensions, then GDB infers that its language is the one indicated.
.c
.C
.cc
.cp
.cpp
.cxx
.c++
.f
.F
.ch
.c186
.c286
.mod
.s
.S
In addition, you may set the language associated with a filename extension. See Displaying the language.