diff --git a/app/lib/ntext.cpp b/app/lib/ntext.cpp index c91edb6d..e9ca2982 100644 --- a/app/lib/ntext.cpp +++ b/app/lib/ntext.cpp @@ -236,7 +236,7 @@ const char* PositionalNumeralSystem::GetText(double number) if (exponent != 0) { buf->Append('e'); buf->Append(exponent > 0 ? '+' : '-'); - IntegerToBuffer(fabs(exponent), 3, &digitout); + IntegerToBuffer(abs(exponent), 3, &digitout); } // Make sure no rounding error is returned @@ -447,7 +447,7 @@ const char* DecimalSystem::GetRealText(double value) while (buf->RemoveTrailing('0')) ; buf->RemoveTrailing(fractionpoint); - delete out; + delete[] out; return buf->GetString(); } diff --git a/app/main/lexer.cpp b/app/main/lexer.cpp index 19bca497..5f524fe1 100644 --- a/app/main/lexer.cpp +++ b/app/main/lexer.cpp @@ -45,7 +45,7 @@ Lexer::~Lexer() delete [] input; if (first != NOMEM) { - delete first; + delete [] first; } } @@ -205,7 +205,7 @@ bool Lexer::GetDigitValue() *(text + len) = '\0'; current = new Token(current, symnumber, text, pos); - delete text; + delete [] text; delete number; pos += len; diff --git a/app/system/language.cpp b/app/system/language.cpp index 80fca41f..d392dd74 100644 --- a/app/system/language.cpp +++ b/app/system/language.cpp @@ -156,7 +156,7 @@ char* Language::UntagText(const char* text) unsigned int len = StrLen(untagged) + 1; lastText = new char[len]; MemCopy(lastText, untagged, len); - delete untagged; + delete [] untagged; return lastText; } diff --git a/app/system/language_posix.cpp b/app/system/language_posix.cpp index f60e0a53..f6adb6ef 100644 --- a/app/system/language_posix.cpp +++ b/app/system/language_posix.cpp @@ -98,7 +98,7 @@ bool PosixLanguage::StrIsEqualLoc(const char* s1, const char* s2) char *tmp = new char[len]; strxfrm(tmp, s2, len); bool res = StrIsEqual(s1, tmp); - delete tmp; + delete [] tmp; return res; } diff --git a/app/system/preferences_stdc.cpp b/app/system/preferences_stdc.cpp index c2585db7..9d71e325 100644 --- a/app/system/preferences_stdc.cpp +++ b/app/system/preferences_stdc.cpp @@ -65,7 +65,7 @@ bool StandardPreferences::Load() } } while (c != NULL); - delete buf; + delete [] buf; fclose(file); SetPrefs(text->GetString()); delete text; diff --git a/lib/real/pow.c b/lib/real/pow.c index 89792573..3f02fd51 100644 --- a/lib/real/pow.c +++ b/lib/real/pow.c @@ -42,9 +42,12 @@ #include "prim.h" #include "math.h" -#if __GNUC__ > 2 -#pragma GCC diagnostic ignored "-Wunused-but-set-variable" -#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#ifdef __clang__ +# pragma clang diagnostic ignored "-Wunused-variable" +# pragma clang diagnostic ignored "-Wstrict-aliasing" +#elif defined(__GNUC__) || defined(__GNUG__) && __GNUC__ > 2 +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +# pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif static const double