How to use make and compile as C99?

Posted by djTeller on Stack Overflow See other posts from Stack Overflow or by djTeller
Published on 2010-05-29T12:38:18Z Indexed on 2010/05/29 13:02 UTC
Read the original article Hit count: 596

Filed under:
|
|

I'm trying to compile a linux kernel module using a Makefile:

obj-m += main.o

all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

Which gives me:

main.c:54: warning: ISO C90 forbids mixed declarations and code

I need to switch to C99. After reading I noticed I need to add a flag -std=c99, not sure where it suppose to be added.

How do I change the Makefile so it will compile as C99?

© Stack Overflow or respective owner

Related posts about makefile

Related posts about c99