An advantage of using #pragma once is potential improved compilation
speeds. However, a con is that it's non-standard and therefore, its
behavior can change at any point and can also vary across compilers,
potentially making the code even less portable.

That being said, since Kudu has been using it for a while and has had no
issues, we can do the same since the potential benefits outweigh the cons.

On Wed, Aug 1, 2018 at 11:48 AM, Tim Armstrong <
tarmstr...@cloudera.com.invalid> wrote:

> Todd brought up our include guards on a code review, asking why we don't
> use #pragma once instead: https://gerrit.cloudera.org/#/c/10988/5 . It
> sounds like Kudu has switched to it
>
> #pragma once does seem cleaner and our GCC and Clang versions are modern
> enough to support it.
>
> What do people think about switching to that as the preferred way of
> including headers only once?
>
> - Tim
>

Reply via email to