Closed martin-ueding closed 7 years ago
Hi Martin, I think i found this pattern somewhere and just used it, in one case. It is doubly redundant, I agree. We can remove it I suppose.
Best, B
On Apr 22, 2017, at 9:50 AM, Martin Ueding notifications@github.com wrote:
In some of the tests, I found double include guards. In the file tests/testMInvCG.cc, there is the following:
ifndef
DSLASH_M_W_H # include "dslashm_w.h"
# endif The included file now defines that include guard:
ifndef
DSLASH_M_W_H # define DSLASH_M_W_H I do not really see the point of this structure. This pattern is kind of nice with lacking compilers like MSVC++ which cannot figure out that the file was already included without opening it again. This would increase the compile times. Compilers like GCC are actually able to interpret the #ifndef include guard and not open the file again. So this is not really needed.
Also compile time with QPhiX is already really long, it will probably make no perceivable difference to remove that double include guard. So why are those still around?
We could also just move to #pragma once. That is shorter, less error prone, and also fast on MSVC++ (if that was ever a concern). IBM XL version 12 cannot do that, but that version cannot even do C++0x, so that is of no concern.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
In some of the tests, I found double include guards. In the file
tests/testMInvCG.cc
, there is the following:The included file now defines that include guard:
I do not really see the point of this structure. This pattern is kind of nice with lacking compilers like MSVC++ which cannot figure out that the file was already included without opening it again. This would increase the compile times. Compilers like GCC are actually able to interpret the
#ifndef
include guard and not open the file again. So this is not really needed.Also compile time with QPhiX is already really long, it will probably make no perceivable difference to remove that double include guard. So why are those still around?
We could also just move to
#pragma once
. That is shorter, less error prone, and also fast on MSVC++ (if that was ever a concern). IBM XL version 12 cannot do that, but that version cannot even do C++0x, so that is of no concern.