[Development] #pragma once

Ville Voutilainen ville.voutilainen at gmail.com
Wed Jan 24 16:19:55 CET 2018


On 24 January 2018 at 16:30, Oswald Buddenhagen
<oswald.buddenhagen at qt.io> wrote:
> but that's only tangentially related to the issue at hand, because the
> compiler would still pick only one of the files under normal
> circumstances. a problem would arise if different include styles in
> different files lead to different headers being picked up from the same
> -I list. it's fairly hard to construct such a case, and it *probably*
> doesn't appear inside qt's "regular" build system (that specifically
> excludes webkit & webengine).


That risk is not worth taking. Get your include guards right, and
don't mess with #pragma once.
There are tools that can help, but I haven't used them myself, and I
don't know whether clang
has anything for this.



More information about the Development mailing list