fix: Workaround that broke functionality. Instead disable warnings
This actually fixes #515 for now
This commit is contained in:
parent
39c743631b
commit
088205385f
@ -2,9 +2,14 @@
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
// TODO: Workaround for weird issue picked up by GCC 12.1.0 and later. This seems like a compiler bug mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wrestrict"
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overread"
|
||||
#include <map>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <hex/helpers/fs.hpp>
|
||||
#include <hex/helpers/file.hpp>
|
||||
|
@ -42,10 +42,6 @@ namespace hex {
|
||||
continue;
|
||||
if (delimiterPos >= line.length())
|
||||
continue;
|
||||
if (delimiterPos >= from.length())
|
||||
continue;
|
||||
if (delimiterPos >= to.length())
|
||||
continue;
|
||||
|
||||
from = line.substr(0, delimiterPos);
|
||||
to = line.substr(delimiterPos + 1);
|
||||
|
@ -204,11 +204,15 @@ namespace hex {
|
||||
}
|
||||
|
||||
std::vector<std::string> splitString(const std::string &string, const std::string &delimiter) {
|
||||
size_t start = 0, end;
|
||||
size_t start = 0, end = 0;
|
||||
std::string token;
|
||||
std::vector<std::string> res;
|
||||
|
||||
while ((end = string.find(delimiter, start)) != std::string::npos) {
|
||||
size_t size = end - start;
|
||||
if (start + size > string.length())
|
||||
break;
|
||||
|
||||
token = string.substr(start, end - start);
|
||||
start = end + delimiter.length();
|
||||
res.push_back(token);
|
||||
|
Loading…
Reference in New Issue
Block a user