[Freeipa-devel] [PATCH 0094] Migrate from #ifndef guards to #pragma once

Nathaniel McCallum npmccallum at redhat.com
Fri May 27 15:33:54 UTC 2016


On Tue, 2016-05-24 at 12:25 -0400, Nathaniel McCallum wrote:
> On Tue, 2016-05-24 at 11:01 -0400, Nathaniel McCallum wrote:
> > On Tue, 2016-05-24 at 16:55 +0200, Martin Kosek wrote:
> > > On 05/24/2016 04:29 PM, Nathaniel McCallum wrote:
> > > > Using a pragma instead of guards is easier to write, less error
> > > > prone
> > > > and avoids name clashes (a source of very subtle bugs). This
> > > > pragma
> > > > is supported on almost all compilers, including all the
> > > > compilers
> > > > we
> > > > care about: https://en.wikipedia.org/wiki/Pragma_once#Portabili
> > > > ty
> > > > .
> > > > 
> > > > 
> > > > 
> > > 
> > > Makes sense to me. I did not test, just saw a potential
> > > typo/omission:
> > > 
> > > --- a/daemons/ipa-otpd/internal.h
> > > +++ b/daemons/ipa-otpd/internal.h
> > > @@ -20,9 +20,6 @@
> > >   * along with this program.  If not, see <http://www.gnu.org/lic
> > > en
> > > se
> > > s/>.
> > >   */
> > > 
> > > -#ifndef INTERNAL_H_
> > > -#define INTERNAL_H_
> > > -
> > > 
> > > 
> > > ... no pragma there.
> > 
> > Fixed.
> 
> Here is a new version with a slightly edited commit message (just to
> confirm that we don't edit the autogenerated files).

Attached is a new version that is simply rebased on to master.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-npmccallum-0094-Migrate-from-ifndef-guards-to-pragma-once.patch
Type: text/x-patch
Size: 10534 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160527/af2e59af/attachment.bin>


More information about the Freeipa-devel mailing list