summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2024-03-05 12:34:56 +0100
committerRobert Griebl <robert.griebl@qt.io>2024-03-05 15:05:16 +0100
commit7576e4339d02442cb0fc148924bce98bdc46c3e0 (patch)
treeb9cb9ec94186186e5389d7af923f7f25fc36d4ae
parentfef939cf879f691b8f487c56897ba54e1c696a1c (diff)
Revert "synqt.cpp: scan for and reject #pragma once"
This breaks qtapplicationmanager, which uses #pragma once exclusively. That repo is fixed for 6.7/dev, but backporting that huge patch to 6.6 (dead) and 6.5 (LTS) is not very practical and also odd to have that late in the LTS release cycle. This reverts commit 656fb759115467de31b771b0138411e73d2b643a. Pick-to: 6.5 Change-Id: I04576453a1b06878d2afa2ef1e6dda038ce864ad Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/tools/syncqt/main.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/tools/syncqt/main.cpp b/src/tools/syncqt/main.cpp
index 7d34875abd..ac93d659c2 100644
--- a/src/tools/syncqt/main.cpp
+++ b/src/tools/syncqt/main.cpp
@@ -43,10 +43,9 @@ enum HeaderChecks {
PrivateHeaderChecks = 2, /* Checks if the public header includes a private header */
IncludeChecks = 4, /* Checks if the real header file but not an alias is included */
WeMeantItChecks = 8, /* Checks if private header files contains 'We meant it' disclaimer */
- PragmaOnceChecks = 16,
- /* Checks that lead to the fatal error of the sync process: */
- CriticalChecks = PrivateHeaderChecks | PragmaOnceChecks,
- AllChecks = NamespaceChecks | CriticalChecks | IncludeChecks | WeMeantItChecks,
+ CriticalChecks = PrivateHeaderChecks, /* Checks that lead to the fatal error of the sync
+ process */
+ AllChecks = NamespaceChecks | PrivateHeaderChecks | IncludeChecks | WeMeantItChecks,
};
constexpr int LinkerScriptCommentAlignment = 55;
@@ -1062,9 +1061,6 @@ public:
static const std::regex MacroRegex("^\\s*#.*");
// The regex's bellow check line for known pragmas:
- //
- // - 'once' is not allowed in installed headers, so error out.
- //
// - 'qt_sync_skip_header_check' avoid any header checks.
//
// - 'qt_sync_stop_processing' stops the header proccesing from a moment when pragma is
@@ -1092,7 +1088,6 @@ public:
//
// - 'qt_no_master_include' indicates that syncqt should avoid including this header
// files into the module master header file.
- static const std::regex OnceRegex(R"(^#\s*pragma\s+once$)");
static const std::regex SkipHeaderCheckRegex("^#\\s*pragma qt_sync_skip_header_check$");
static const std::regex StopProcessingRegex("^#\\s*pragma qt_sync_stop_processing$");
static const std::regex SuspendProcessingRegex("^#\\s*pragma qt_sync_suspend_processing$");
@@ -1279,13 +1274,6 @@ public:
} else if (std::regex_match(buffer, match, DeprecatesPragmaRegex)) {
m_deprecatedHeaders[match[1].str()] =
m_commandLineArgs->moduleName() + '/' + m_currentFilename;
- } else if (std::regex_match(buffer, OnceRegex)) {
- if (!(skipChecks & PragmaOnceChecks)) {
- faults |= PragmaOnceChecks;
- error() << "\"#pragma once\" is not allowed in installed header files: "
- "https://lists.qt-project.org/pipermail/development/2022-October/043121.html"
- << std::endl;
- }
} else if (std::regex_match(buffer, match, IncludeRegex) && !isSuspended) {
if (!(skipChecks & IncludeChecks)) {
std::string includedHeader = match[1].str();