Messages in this thread | | | Date | Sun, 12 Jan 2014 11:14:56 -0500 | Subject | Re: #pragma once? | From | Patrick Palka <> |
| |
On Mon, Jan 6, 2014 at 3:47 PM, Josh Triplett <josh@joshtriplett.org> wrote: > Does anyone have any objection to the use of "#pragma once" instead of > the usual #ifndef-#define-...-#endif include guard? GCC, LLVM/clang, > and the latest Sparse all support either method just fine. (I added > support to Sparse myself.) Both have equivalent performance. "#pragma > once" is simpler, and avoids the possibility of a typo in the defined > guard symbol.
Unfortunately in GCC #pragma once is slower and slightly buggier than regular include guards:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52566 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770
| |