On 2006-04-10, at 18:16:17 -0700, Marvin Humphrey wrote:

> > Are there any flags I could pass to the C compiler to  
> > force it to choke on variable declarations that are illegal under C89?
> 
> -Wall, -pedantic among others.... Thanks for the private replies.

Try -std=c89 if you're using gcc:

  $ cc -std=c89 -pedantic -o const const.c 
  const.c: In function `main':
  const.c:9: warning: ISO C90 forbids mixed declarations and code

If you want it to choke, try adding -Werror.

HTH,
Marcus

Reply via email to