Re: #pragma once (was Re: incoming)

2021-03-01 Thread Al Viro
On Sat, Feb 27, 2021 at 02:02:21AM +0300, Alexey Dobriyan wrote: > There are rules and schemes about how to create guard macro. > > Should it be prefixed by underscore? > Should it be prefixed by two underscores? > Should it be full path uppercased or just last path component? > Should the guard

RE: #pragma once (was Re: incoming)

2021-03-01 Thread David Laight
From: Alexey Dobriyan > Sent: 26 February 2021 23:02 > > On Fri, Feb 26, 2021 at 01:53:48PM -0800, Linus Torvalds wrote: > > On Fri, Feb 26, 2021 at 12:17 PM Alexey Dobriyan > > wrote: > > > > > > I want to sent treewide "#pragma once" conversion: > > > > Are there *any* advantages to it? > >

Re: #pragma once (was Re: incoming)

2021-02-26 Thread Alexey Dobriyan
On Fri, Feb 26, 2021 at 01:53:48PM -0800, Linus Torvalds wrote: > On Fri, Feb 26, 2021 at 12:17 PM Alexey Dobriyan wrote: > > > > I want to sent treewide "#pragma once" conversion: > > Are there *any* advantages to it? > > It's non-standard, It is effectively standard:

Re: #pragma once (was Re: incoming)

2021-02-26 Thread Linus Torvalds
On Fri, Feb 26, 2021 at 12:17 PM Alexey Dobriyan wrote: > > I want to sent treewide "#pragma once" conversion: Are there *any* advantages to it? It's non-standard, and the historical argument for it ("it can reduce compile times because the preprocessor doesn't open the file twice" is pure and

Re: #pragma once?

2014-01-12 Thread Josh Triplett
On Sun, Jan 12, 2014 at 11:14:56AM -0500, Patrick Palka wrote: > 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

Re: #pragma once?

2014-01-12 Thread Patrick Palka
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.)

Re: #pragma once?

2014-01-12 Thread Patrick Palka
On Mon, Jan 6, 2014 at 3:47 PM, Josh Triplett j...@joshtriplett.org 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

Re: #pragma once?

2014-01-12 Thread Josh Triplett
On Sun, Jan 12, 2014 at 11:14:56AM -0500, Patrick Palka wrote: On Mon, Jan 6, 2014 at 3:47 PM, Josh Triplett j...@joshtriplett.org 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

Re: #pragma once?

2014-01-07 Thread Josh Triplett
On Tue, Jan 07, 2014 at 10:48:53AM +0100, Geert Uytterhoeven wrote: > On Tue, Jan 7, 2014 at 6:55 AM, Sam Ravnborg wrote: > > On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: > >> [CCing build-system folks and others likely to know about potential > >> issues.] > >> > >> Does anyone

Re: #pragma once?

2014-01-07 Thread Josh Triplett
On Tue, Jan 07, 2014 at 11:09:11AM +0100, Michal Marek wrote: > On 2014-01-07 10:48, Geert Uytterhoeven wrote: > > Furthermore some userspace may rely on doing #define XXX to avoid > > including a specific kernel header (yes, it's ugly). > > This pattern is also sometimes used: > $ head -6

Re: #pragma once?

2014-01-07 Thread Michal Marek
On 2014-01-07 10:48, Geert Uytterhoeven wrote: > Furthermore some userspace may rely on doing #define XXX to avoid > including a specific kernel header (yes, it's ugly). This pattern is also sometimes used: $ head -6 include/linux/spinlock_up.h #ifndef __LINUX_SPINLOCK_UP_H #define

Re: #pragma once?

2014-01-07 Thread Geert Uytterhoeven
On Tue, Jan 7, 2014 at 6:55 AM, Sam Ravnborg wrote: > On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: >> [CCing build-system folks and others likely to know about potential >> issues.] >> >> Does anyone have any objection to the use of "#pragma once" instead of >> the usual

Re: #pragma once?

2014-01-07 Thread Geert Uytterhoeven
On Tue, Jan 7, 2014 at 6:55 AM, Sam Ravnborg s...@ravnborg.org wrote: On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: [CCing build-system folks and others likely to know about potential issues.] Does anyone have any objection to the use of #pragma once instead of the usual

Re: #pragma once?

2014-01-07 Thread Michal Marek
On 2014-01-07 10:48, Geert Uytterhoeven wrote: Furthermore some userspace may rely on doing #define XXX to avoid including a specific kernel header (yes, it's ugly). This pattern is also sometimes used: $ head -6 include/linux/spinlock_up.h #ifndef __LINUX_SPINLOCK_UP_H #define

Re: #pragma once?

2014-01-07 Thread Josh Triplett
On Tue, Jan 07, 2014 at 11:09:11AM +0100, Michal Marek wrote: On 2014-01-07 10:48, Geert Uytterhoeven wrote: Furthermore some userspace may rely on doing #define XXX to avoid including a specific kernel header (yes, it's ugly). This pattern is also sometimes used: $ head -6

Re: #pragma once?

2014-01-07 Thread Josh Triplett
On Tue, Jan 07, 2014 at 10:48:53AM +0100, Geert Uytterhoeven wrote: On Tue, Jan 7, 2014 at 6:55 AM, Sam Ravnborg s...@ravnborg.org wrote: On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: [CCing build-system folks and others likely to know about potential issues.] Does

Re: #pragma once?

2014-01-06 Thread Sam Ravnborg
On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: > [CCing build-system folks and others likely to know about potential > issues.] > > Does anyone have any objection to the use of "#pragma once" instead of > the usual #ifndef-#define-...-#endif include guard? GCC, LLVM/clang, > and

Re: #pragma once?

2014-01-06 Thread Dave Jones
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

Re: #pragma once?

2014-01-06 Thread Theodore Ts'o
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

Re: #pragma once?

2014-01-06 Thread Josh Triplett
On Mon, Jan 06, 2014 at 01:00:03PM -0800, Andrew Morton wrote: > On Mon, 6 Jan 2014 12:47:07 -0800 Josh Triplett wrote: > > > Does anyone have any objection to the use of "#pragma once" instead of > > the usual #ifndef-#define-...-#endif include guard? > > Sounds OK to me. gcc has supported

Re: #pragma once?

2014-01-06 Thread Andrew Morton
On Mon, 6 Jan 2014 12:47:07 -0800 Josh Triplett wrote: > Does anyone have any objection to the use of "#pragma once" instead of > the usual #ifndef-#define-...-#endif include guard? Sounds OK to me. gcc has supported this for quite a long time, yes? I wonder if ICC supports it. (I haven't

Re: #pragma once?

2014-01-06 Thread Andrew Morton
On Mon, 6 Jan 2014 12:47:07 -0800 Josh Triplett j...@joshtriplett.org wrote: Does anyone have any objection to the use of #pragma once instead of the usual #ifndef-#define-...-#endif include guard? Sounds OK to me. gcc has supported this for quite a long time, yes? I wonder if ICC supports

Re: #pragma once?

2014-01-06 Thread Josh Triplett
On Mon, Jan 06, 2014 at 01:00:03PM -0800, Andrew Morton wrote: On Mon, 6 Jan 2014 12:47:07 -0800 Josh Triplett j...@joshtriplett.org wrote: Does anyone have any objection to the use of #pragma once instead of the usual #ifndef-#define-...-#endif include guard? Sounds OK to me. gcc has

Re: #pragma once?

2014-01-06 Thread Theodore Ts'o
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

Re: #pragma once?

2014-01-06 Thread Dave Jones
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

Re: #pragma once?

2014-01-06 Thread Sam Ravnborg
On Mon, Jan 06, 2014 at 12:47:07PM -0800, Josh Triplett wrote: [CCing build-system folks and others likely to know about potential issues.] 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