From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from movementarian.org ([178.79.150.28]:42176 "EHLO movementarian.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730166AbfAKMvM (ORCPT ); Fri, 11 Jan 2019 07:51:12 -0500 Received: from movement by movementarian.org with local (Exim 4.91) (envelope-from ) id 1ghvzN-0002yf-24 for smatch@vger.kernel.org; Fri, 11 Jan 2019 12:32:41 +0000 Date: Fri, 11 Jan 2019 12:32:41 +0000 From: John Levon Subject: Odd smatch issue? Message-ID: <20190111123241.GA11408@movementarian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: smatch-owner@vger.kernel.org List-ID: To: smatch@vger.kernel.org static long lx_cap_update_priv(void) { const int lx_cap_mapping[4] = { 0, 0, 0 }; int i = 63; /* enabling the below line disables the warning */ //int cap_set = i == 0; lx_cap_mapping[i]; } /home/gk/src/smatch/smatch: a.c:8 lx_cap_update_priv() error: buffer overflow 'lx_cap_mapping' 4 <= 63 Distilled down from some real code, obviously, but it seems odd that just *looking* at "i" means smatch can't figure out its max value? thanks john