From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kamil Dudka Subject: Re: sparse segv with simple test Date: Mon, 31 Aug 2009 20:12:36 +0200 Message-ID: <200908312012.37019.kdudka@redhat.com> References: <20090830153202.4dc5c58c@s6510> <200908310053.59138.kdudka@redhat.com> <20090831085758.540365f2@nehalam> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59055 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791AbZHaSOb (ORCPT ); Mon, 31 Aug 2009 14:14:31 -0400 In-Reply-To: <20090831085758.540365f2@nehalam> Content-Disposition: inline Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Stephen Hemminger Cc: Josh Triplett , linux-sparse@vger.kernel.org On Monday 31 of August 2009 17:57:58 Stephen Hemminger wrote: > Not sure why, but the crash went away after a 'make clean; make' so maybe > something was stale on that machine? Could be ... outdated depfiles, skewed mtimes, etc. > It still doesn't give any warnings. about assigning an enum with a value > out of range thou. AFAICT it is not supposed to issue a warning in that case. Here is an example which is caught by the check: static void f(void) { enum A { VAL_A } a = VAL_A; enum B { VAL_B } b = a; } $ sparse enum.c enum.c:3:26: warning: mixing different enum types enum.c:3:26: int enum A versus enum.c:3:26: int enum B Note that you don't even need to write -Wenum-mismatch since it's default. But it might be good idea to implement such out-of-range detection ;-) Kamil