Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbaLESuV (ORCPT ); Fri, 5 Dec 2014 13:50:21 -0500 Received: from mail-qc0-f174.google.com ([209.85.216.174]:44426 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbaLESuU (ORCPT ); Fri, 5 Dec 2014 13:50:20 -0500 MIME-Version: 1.0 In-Reply-To: <20141205095423.GB4963@mwanda> References: <1417010419-3827-1-git-send-email-sasha.levin@oracle.com> <547620E6.10306@oracle.com> <20141127204257.GA11014@mwanda> <20141205095423.GB4963@mwanda> Date: Fri, 5 Dec 2014 10:50:19 -0800 X-Google-Sender-Auth: ZgR7INhRF2pFP4iiIg3TeTp6F_M Message-ID: Subject: Re: [RFC 1/2] compiler: use compiler to detect integer overflows From: Linus Torvalds To: Dan Carpenter Cc: Sasha Levin , Kernel Mailing List , Andrew Morton , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 5, 2014 at 1:54 AM, Dan Carpenter wrote: > > There are some false positives which do: > > if ((u16)(u16_foo + u16_bar) < u16_foo) { Actually, the worse false positive is the ones that are pointer comparisons. A compiler that does those as signed is just broken. It's happened, but it's *still* completely broken. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/