lkml.org 
[lkml]   [2018]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-11-08 18:23    [W:0.233 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site