Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756124AbaAFVvc (ORCPT ); Mon, 6 Jan 2014 16:51:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26134 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755835AbaAFVva (ORCPT ); Mon, 6 Jan 2014 16:51:30 -0500 Date: Mon, 6 Jan 2014 16:50:57 -0500 From: Dave Jones To: "Theodore Ts'o" Cc: Josh Triplett , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Greg Kroah-Hartman , Michal Marek , Sam Ravnborg , Rashika Kheria Subject: Re: #pragma once? Message-ID: <20140106215057.GB25059@redhat.com> Mail-Followup-To: Dave Jones , Theodore Ts'o , Josh Triplett , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Greg Kroah-Hartman , Michal Marek , Sam Ravnborg , Rashika Kheria References: <20140106204706.GA16924@leaf> <20140106213349.GF28490@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140106213349.GF28490@thunk.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 06, 2014 at 04:33:49PM -0500, Theodore Ts'o wrote: > On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: > > Does anyone have any objection to the use of "#pragma once" instead of > > the usual #ifndef-#define-...-#endif include guard? GCC, LLVM/clang, > > and the latest Sparse all support either method just fine. (I added > > support to Sparse myself.) Both have equivalent performance. "#pragma > > once" is simpler, and avoids the possibility of a typo in the defined > > guard symbol. > > Does anybody know whether other static code analysis tools such as > Coverity can handle #pragma once? Coverity should be fine. If it does break, I'm sure they'd fix it. Dave -- 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/