Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
Qt Creator 3.1.0
-
aaa8beab88dddd7218f6d3c30fb29c04679e2098 (qt-creator/qt-creator/master)
Description
Auto-generated headers currently use #include guards. It is better to use #pragma once for several reasons, so I suggest the default is changed. The reasons are:
1. It's less verbose and ugly.
2. It's less error-prone - e.g. no risk of two header files using the same guard define.
3. It's faster to compile.
4. It's not as much of a dirty hack.
5. It's been supported on all major compilers for years.
I realise this may attract a degree of "We've always done it this way and it works fine. Why would you want to improve things?" stuck-in-the-muds, but I hope you will ignore them.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-16816 Add an option to use #pragma once instead of the classical header guards when generating C/C++ headers
- Closed
- relates to
-
QTCREATORBUG-18679 Add quick fix to change header guard to #pragma once and vice versa
- Reported
-
QTCREATORBUG-18110 Some settings are missing per-project configuration
- Open