tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: #pragma once



    Date:        Sun, 23 Oct 2022 09:50:20 +0000
    From:        Taylor R Campbell <riastradh%NetBSD.org@localhost>
    Message-ID:  <20221023095027.EB8EF60760%jupiter.mumble.net@localhost>

  | I wasn't able to find a clear statement of the semantics anywhere:
  | Is it keyed by (dev,ino), by pathname, by some kind of normalized
  | pathname, by file content?  gcc's own documentation is very sparse and
  | just describes it as nonportable.

I had not weighed in on this before, but that issue was the biggest
problem I could see with this.

That and that using guards allows having mutually exclusive (but
different) include files ... though of course they could always be
used for any such cases even if the #pragma scheme became the normal
way.

  | So on balance,  #pragma once  doesn't seem worthwhile to me today, and
  | I think we should stick to traditional include guards for now.

I agree.

kre




Home | Main Index | Thread Index | Old Index