Messages in this thread | | | From | David Laight <> | Subject | RE: #pragma once (was Re: incoming) | Date | Mon, 1 Mar 2021 16:52:16 +0000 |
| |
From: Alexey Dobriyan <adobriyan@gmail.com> > 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 <adobriyan@gmail.com> wrote: > > > > > > I want to sent treewide "#pragma once" conversion: > > > > Are there *any* advantages to it? > > > > It's non-standard, > > It is effectively standard: > https://en.wikipedia.org/wiki/Pragma_once#Portability
At the top of the page....
In the C and C++ programming languages, pragma once is a non-standard but widely supported
So non-standard :-)
And #pragma is ugly...
There are also times when an include guard has to be set in order to stop a problematic inner file being included. Perhaps only during hacking, but it is useful.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |