From ef37ae437c194fdbe5281f530b66002bbb5633fc Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 20 Dec 2021 22:46:38 +0100 Subject: [PATCH] Fix compile error with Clang related to diagnostic pragma Fix ``` pragma diagnostic pop could not pop, no matching push ``` The GCC documentation says "If a pop has no matching push, the command-line options are restored." but that's apparently not working here. --- misc/levenshtein.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/levenshtein.cpp b/misc/levenshtein.cpp index c1f3ef8..a0a0164 100644 --- a/misc/levenshtein.cpp +++ b/misc/levenshtein.cpp @@ -33,6 +33,7 @@ void initDistanceArray(DistanceArray &distanceArray, const size_t size1, const s const auto maxDistance(size1 + size2); // ignore warning about null pointer dereference for now (which is *likely* not correct) #ifdef __GNUC__ +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnull-dereference" #endif distanceArray.at(0, 0) = maxDistance;