...which is the correct thing to do. Said include guard is not the problem, but the comment line is.
Although gcc incidentially does remove comments before doing include guard optimisation, it isn't required to do so, and not all compilers do that. For include optimisation to work reliably, the only thing that is allowed to appear before and after the header guards is whitespace.