I found the following softwares that support UML code generation for C programming language:
1. Eclipse
As you know, Eclipse is an IDE that mainly for Java programming language. Eclipse has a capability to support features from its plug-in. One of them is UML generator. Eclipse UML generator supports Java and C programming languages. It can either generate or reverse. For this context, this plug-in has C code generator called UML2C. It converts class and state diagrams.
2. Enterprise Architect
Enterprise Architect is a modeling software. This software can be treated as an IDE for modeling because it has complex features. Enterprise Architect supports C code generation from UML models. It supports not only class diagram but also state, sequence, and activity diagrams. This feature guide is available on this page.
3. Astah
Astah is also a modelling software. It has some different products. Astah can generate C source code from UML class models via a plug-in called UML2c. This plug-in just only supports class diagram.
Note that, all of softwares above are not free software, except Eclipse. Astah can be purchased free for student only. I recommend to check the pricing page.
I don't know either if a modeling software can generate source code from ERDs. ERD is a model that draws relationship between data and basically for database. If I am not mistaken, you want to generate SQL from ERDs.