[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181108172225.GH7543@zn.tnic>
Date: Thu, 8 Nov 2018 18:22:25 +0100
From: Borislav Petkov <bp@...en8.de>
To: Michael Matz <matz@...e.de>
Cc: Yi Wang <wang.yi59@....com.cn>, tglx@...utronix.de,
mingo@...hat.com, hpa@...or.com, x86@...nel.org,
suravee.suthikulpanit@....com, puwen@...on.cn,
davidwang@...oxin.com, linux-kernel@...r.kernel.org,
zhong.weidong@....com.cn
Subject: Re: [PATCH v2] x86/cpu: fix prototype warning
On Thu, Nov 08, 2018 at 03:47:32PM +0000, Michael Matz wrote:
> What tglx said. If you don't intend such functions to be called
> from other units make them static, if you do intend them to be callable
> declare the properly.
>
> [There's also one subtle issue with argument promotions. prototypeless
> functions are called as if they are declared "int name()" that is
> default argument promotions take place (float->double, {char,short}->int),
> which won't happen with prototypes, and argument type conversions won't
> take place (as no parameter types are known). This might lead to
> different values between calling a prototyped and a prototype-less
> function arriving at the function even though the call expression looked
> the same]
Eww, that's yucky.
Ok, so we should enalbe this warning by default then. And doing that in
the main Makefile gives ~1400 warnings on an allmodconfig build.
Yi Wang, I guess you have a long road in front of you. :-)
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists