Well, if you want to do more advanced stuff with your AVRs, you should definitely leave the Arduino environment, and integrate your AVR development in your "usual" favorite development environment, whatever it is.
Then you've got two choices, either do 100% pure C with AVR libraries, for which you only need a simple makefile that calls avr-gcc with avr-libc libraries as include path. You can also use Atmel Studio that helps you a lot on that stuff. But if you do so, you're loosing the advantages of the libraries built for/by the arduino community – which, sadly, is not a huge loss for a strong majority of those.
Or you can work your code out as a 100% C external library, used from within the sketch, and included at linking time. Then you'll have all the advantages of working with any C++ library you'd like to have, but still doing the important code in pure C. Having only the
.ino used to generate the main
.cpp and any
.cpp library you'd need. Though, for many basic features like writing on the serial port, you'll have to do it [the good old way] or by doing some weird encapsulation of
Serial.println() call sent as a functor to the pure C parts.
In the makefile I've written (debian offers another one with the non-gui install of arduino), every
.c file from declared libraries are detected and compiled with avr-gcc, every
.cpp file is compiled with
avr-g++ and both gets linked when doing the