bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] src/sort.c: sort() is always called with nfiles > 0


From: Pádraig Brady
Subject: Re: [PATCH] src/sort.c: sort() is always called with nfiles > 0
Date: Wed, 06 Jan 2010 14:01:57 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

On 06/01/10 08:36, Kovarththanan Rajaratnam wrote:
clang detected the following false positive:

sort.c:2946:3: warning: Pass-by-value argument in function call is undefined
   free (buf.buf);
   ^     ~~~~~~~

src/sort.c: Add an assert indicating that sort() is always called with nfiles>  
0. This allows clang to deduce that 'buf.buf' is always set/valid.

Signed-off-by: Kovarththanan Rajaratnam<address@hidden>

Again this false positive is triggered as it looks like
alang is analyzing the functions in isolation, rather
than the whole compilation unit. Is there an option
to get clang to consider just the whole compilation unit?

cheers,
Pádraig.




reply via email to

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