lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: #pragma once (was Re: incoming)
Date
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)
\
 
 \ /
  Last update: 2021-03-01 20:37    [W:1.008 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site