From 7bc436557370e884382c21eeaad838826540d5ff Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 4 Apr 2023 08:27:22 +0800 Subject: [PATCH] - change: Remove the compiler set option "Syntax error when object larger than" --- NEWS.md | 3 +- RedPandaIDE/compiler/compiler.cpp | 10 ---- RedPandaIDE/settings.cpp | 43 ---------------- RedPandaIDE/settings.h | 8 --- .../compilersetoptionwidget.cpp | 4 -- .../settingsdialog/compilersetoptionwidget.ui | 51 ------------------- 6 files changed, 1 insertion(+), 118 deletions(-) diff --git a/NEWS.md b/NEWS.md index 47010b94..1e7e3583 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,8 @@ Red Panda C++ Version 2.20 - - change: Change compiler set option "Syntax error when object larger than" to "Syntax error when function frame larger than" + - change: Remove the compiler set option "Syntax error when object larger than" - fix: Projects created by some templates are not correct when editor's default encoding is not utf8. - fix: File/Project visit histories are not correctly saved when clearing. - - change: Default max function frame size is 2MB under windows / 8MB others. - fix: Octal numeric escape sequences is not correctly syntax highlighted. - enhancement: Refine suggestion info when try debug and the compiler settings are not correct. - enhancement: Open the options dialog/project options dialog when user want to correct compiler settings for debug. diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index 064a82cd..bbf9039c 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -423,11 +423,6 @@ QString Compiler::getCCompileArguments(bool checkSyntax) foreach(const QString& param, params) result += " "+ parseMacros(param); } - } else { - if (compilerSet()->maxFrameSize()>0 && compilerSet()->warnLargeFrame()) { - long long size = std::ceil(compilerSet()->maxFrameSize()*1024*1024); - result += QString(" -Werror=frame-larger-than=%1").arg(size); - } } return result; } @@ -468,11 +463,6 @@ QString Compiler::getCppCompileArguments(bool checkSyntax) foreach(const QString& param, params) result += " "+ parseMacros(param); } - } else { - if (compilerSet()->maxFrameSize()>0 && compilerSet()->warnLargeFrame()) { - long long size = std::ceil(compilerSet()->maxFrameSize()*1024*1024); - result += QString(" -Werror=frame-larger-than=%1").arg(size); - } } return result; } diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index d493d95c..2581afd9 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -1669,8 +1669,6 @@ Settings::CompilerSet::CompilerSet(): mAutoAddCharsetParams{false}, mExecCharset{ENCODING_SYSTEM_DEFAULT}, mStaticLink{false}, - mMaxFrameSize{0}, - mWarnLargeObject{false}, mPreprocessingSuffix{DEFAULT_PREPROCESSING_SUFFIX}, mCompilationProperSuffix{DEFAULT_COMPILATION_SUFFIX}, mAssemblingSuffix{DEFAULT_ASSEMBLING_SUFFIX}, @@ -1685,8 +1683,6 @@ Settings::CompilerSet::CompilerSet(const QString& compilerFolder, const QString& mAutoAddCharsetParams{true}, mExecCharset{ENCODING_SYSTEM_DEFAULT}, mStaticLink{true}, - mMaxFrameSize{0}, - mWarnLargeObject{false}, mPreprocessingSuffix{DEFAULT_PREPROCESSING_SUFFIX}, mCompilationProperSuffix{DEFAULT_COMPILATION_SUFFIX}, mAssemblingSuffix{DEFAULT_ASSEMBLING_SUFFIX}, @@ -1742,8 +1738,6 @@ Settings::CompilerSet::CompilerSet(const Settings::CompilerSet &set): mAutoAddCharsetParams{set.mAutoAddCharsetParams}, mExecCharset{set.mExecCharset}, mStaticLink{set.mStaticLink}, - mMaxFrameSize{set.mMaxFrameSize}, - mWarnLargeObject{set.mWarnLargeObject}, mPreprocessingSuffix{set.mPreprocessingSuffix}, mCompilationProperSuffix{set.mCompilationProperSuffix}, @@ -2569,26 +2563,6 @@ QByteArray Settings::CompilerSet::getCompilerOutput(const QString &binDir, const return result.trimmed(); } -bool Settings::CompilerSet::warnLargeFrame() const -{ - return mWarnLargeObject; -} - -void Settings::CompilerSet::setWarnLargeFrame(bool newWarnLargeObject) -{ - mWarnLargeObject = newWarnLargeObject; -} - -double Settings::CompilerSet::maxFrameSize() const -{ - return mMaxFrameSize; -} - -void Settings::CompilerSet::setMaxFrameSize(double maxFrameSize) -{ - mMaxFrameSize = maxFrameSize; -} - Settings::CompilerSet::CompilationStage Settings::CompilerSet::compilationStage() const { return mCompilationStage; @@ -2758,12 +2732,6 @@ static void setReleaseOptions(Settings::PCompilerSet pSet) { pSet->setCompileOption(LINK_CMD_OPT_STRIP_EXE, COMPILER_OPTION_ON); pSet->setCompileOption(CC_CMD_OPT_USE_PIPE, COMPILER_OPTION_ON); pSet->setStaticLink(true); -#ifdef Q_OS_WIN - pSet->setMaxFrameSize(2); //default stack size of gcc is 2MB on windows -#else - pSet->setMaxFrameSize(8); -#endif - pSet->setWarnLargeFrame(false); } static void setDebugOptions(Settings::PCompilerSet pSet, bool enableAsan = false) { @@ -2783,12 +2751,6 @@ static void setDebugOptions(Settings::PCompilerSet pSet, bool enableAsan = false pSet->setCompileOption(CC_CMD_OPT_STACK_PROTECTOR, "-strong"); pSet->setStaticLink(false); -#ifdef Q_OS_WIN - pSet->setMaxFrameSize(2); //default stack size of gcc is 2MB on windows -#else - pSet->setMaxFrameSize(8); -#endif - pSet->setWarnLargeFrame(true); } bool Settings::CompilerSets::addSets(const QString &folder, const QString& c_prog) { @@ -3130,9 +3092,6 @@ void Settings::CompilerSets::saveSet(int index) mSettings->mSettings.setValue("AddCharset", pSet->autoAddCharsetParams()); mSettings->mSettings.setValue("StaticLink", pSet->staticLink()); mSettings->mSettings.setValue("ExecCharset", pSet->execCharset()); - mSettings->mSettings.setValue("WarnLargeFrame",pSet->warnLargeFrame()); - mSettings->mSettings.setValue("MaxFrameSize",pSet->maxFrameSize()); - mSettings->mSettings.setValue("preprocessingSuffix", pSet->preprocessingSuffix()); mSettings->mSettings.setValue("compilationProperSuffix", pSet->compilationProperSuffix()); @@ -3216,8 +3175,6 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index) pSet->setCustomLinkParams(mSettings->mSettings.value("customLinkParams").toString()); pSet->setAutoAddCharsetParams(mSettings->mSettings.value("AddCharset", true).toBool()); pSet->setStaticLink(mSettings->mSettings.value("StaticLink", false).toBool()); - pSet->setMaxFrameSize(mSettings->mSettings.value("MaxFrameSize", 2).toDouble()); - pSet->setWarnLargeFrame(mSettings->mSettings.value("WarnLargeFrame", false).toBool()); pSet->setExecCharset(mSettings->mSettings.value("ExecCharset", ENCODING_SYSTEM_DEFAULT).toString()); if (pSet->execCharset().isEmpty()) { diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index c2ed4746..a803a2a2 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -1427,12 +1427,6 @@ public: bool isOutputExecutable(); bool isOutputExecutable(Settings::CompilerSet::CompilationStage stage); - double maxFrameSize() const; - void setMaxFrameSize(double maxFrameSize); - - bool warnLargeFrame() const; - void setWarnLargeFrame(bool newWarnLargeObject); - private: void setDirectories(const QString& binDir, CompilerType mCompilerType); //load hard defines @@ -1478,8 +1472,6 @@ public: bool mAutoAddCharsetParams; QString mExecCharset; bool mStaticLink; - double mMaxFrameSize; - bool mWarnLargeObject; QString mPreprocessingSuffix; QString mCompilationProperSuffix; diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp index 461b774d..a55c5808 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp @@ -88,8 +88,6 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet ui->txtCustomLinkParams->setEnabled(pSet->useCustomLinkParams()); ui->chkAutoAddCharset->setChecked(pSet->autoAddCharsetParams()); ui->chkStaticLink->setChecked(pSet->staticLink()); - ui->spinMaxObjectSize->setValue(pSet->maxFrameSize()); - ui->chkWarnLargeObject->setChecked(pSet->warnLargeFrame()); //rest tabs in the options widget ui->optionTabs->resetUI(pSet,pSet->compileOptions()); @@ -201,8 +199,6 @@ void CompilerSetOptionWidget::saveCurrentCompilerSet() pSet->setCustomLinkParams(ui->txtCustomLinkParams->toPlainText().trimmed()); pSet->setAutoAddCharsetParams(ui->chkAutoAddCharset->isChecked()); pSet->setStaticLink(ui->chkStaticLink->isChecked()); - pSet->setMaxFrameSize(ui->spinMaxObjectSize->value()); - pSet->setWarnLargeFrame(ui->chkWarnLargeObject->isChecked()); pSet->setCCompiler(ui->txtCCompiler->text().trimmed()); pSet->setCppCompiler(ui->txtCppCompiler->text().trimmed()); diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui index b3dab9a5..6f993544 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui @@ -171,57 +171,6 @@ - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Syntax error for stack frame larger than - - - - - - - MB - - - 999999.000000000000000 - - - 0.500000000000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - -