svn commit: r250577 - head/sys/vm

Peter Wemm peter at wemm.org
Mon May 13 06:53:17 UTC 2013


On Sun, May 12, 2013 at 2:49 PM, Alan Cox <alc at rice.edu> wrote:
> On 05/12/2013 16:37, Andrey Chernov wrote:
>> On 12.05.2013 20:50, Alan Cox wrote:
>>
>> GNU cc errors related to part of diff below:
>> cc1: warnings being treated as errors
>> ../../../vm/vm_page.c: In function 'vm_page_alloc':
>> ../../../vm/vm_page.c:1209: warning: 'mpred' may be used uninitialized
>> in this function
>> *** [vm_page.o] Error code 1
>> Formally yes, mpred here can be left unitialized.
>
> No, it can't.  The code amounts to
>
>     if ("x")
>         mpred = ... ;
>     ...
>     if ("x")
>         use mpred;
>     ...
>     if ("x")
>         use mpred;
>
> where "x" is "object != NULL".  Moreover, there are no assignments to
> the variable "object" or aliases by which the variable "object" can be
> modified over the lifespan of "mpred".  So, this is flawed analysis by
> our antique gcc.

Regardless of who's right or wrong, you've broken about half the
freebsd.org cluster.  It uses a mixture of gcc and clang to catch
sillyness like this.

-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV


More information about the svn-src-all mailing list