avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] How to warn if a function called with extra arguments


From: Richard Urwin
Subject: Re: [avr-gcc-list] How to warn if a function called with extra arguments
Date: Mon, 22 Mar 2004 07:54:50 +0000
User-agent: KMail/1.5.3

On Monday 22 Mar 2004 6:53 am, Tom Harris wrote:
> Greetings,
>
> Here is an example of code that compiles with no warnings:
>
> void f() {
> }
>
> void g() {
>       f(1); // extra argument
> }
>
> I know that it is harmless, but s there a way to persuade gcc to
> print a warning in such cases?
>
> If I declare f as `f(void)` then the compiler complains about the
> extra argument.

Defining f as f() is old K&R C, and it doesn't define how many arguments 
f takes. f(void) is new ISO C, and it defines f to take no arguments.

HTH.

-- 
Richard Urwin

_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list


reply via email to

[Prev in Thread] Current Thread [Next in Thread]