[Development] Using '#pragma once' instead of include guards?

Thiago Macieira thiago.macieira at intel.com
Thu Jan 30 01:30:26 CET 2025


On Wednesday 29 January 2025 09:54:05 Pacific Standard Time Marc Mutz via 
Development wrote:
> Additionally, in light of recent findings where two modules used
> identical header guard macros, I'm again proposing to prefix installed
> header guard macro names with the module name:
> 
>    QUTIL_H -> QTGRAPHS3D_QUTIL_H
>            -> QTDATAVIS3D_QUITL_H

This one has a different problem: we do allow your headers to be included 
without the module name. So what did #include <qutil.h> include?

Header file names must be unique throughout Qt, regardless of whether we adopt 
this recommendation for the guard macros.

But I support the rule of using the module name.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250129/61ca1547/attachment.bin>


More information about the Development mailing list