Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbaALQO6 (ORCPT ); Sun, 12 Jan 2014 11:14:58 -0500 Received: from mail-pb0-f43.google.com ([209.85.160.43]:65154 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbaALQO4 (ORCPT ); Sun, 12 Jan 2014 11:14:56 -0500 MIME-Version: 1.0 X-Originating-IP: [67.83.169.196] In-Reply-To: <20140106204706.GA16924@leaf> References: <20140106204706.GA16924@leaf> Date: Sun, 12 Jan 2014 11:14:56 -0500 Message-ID: Subject: Re: #pragma once? From: Patrick Palka To: Josh Triplett Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Greg Kroah-Hartman , Michal Marek , Sam Ravnborg , Rashika Kheria Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 6, 2014 at 3:47 PM, 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. Unfortunately in GCC #pragma once is slower and slightly buggier than regular include guards: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52566 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770 -- 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/