Commit 32857374 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Enable bugprone-signed-char-misuse

parent 5d3e71c8
Pipeline #240580 passed with stages
in 12 minutes and 20 seconds
......@@ -53,7 +53,7 @@ build_clang_libcpp:
script:
- git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
- mkdir -p build && cd build
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-use-bool-literals,modernize-redundant-void-arg,modernize-loop-convert,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation,-bugprone-sizeof-expression,-bugprone-branch-clone,-bugprone-reserved-identifier,-bugprone-signed-char-misuse,-bugprone-suspicious-include;-warnings-as-errors=*" ..
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-use-bool-literals,modernize-redundant-void-arg,modernize-loop-convert,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation,-bugprone-sizeof-expression,-bugprone-branch-clone,-bugprone-reserved-identifier,-bugprone-suspicious-include;-warnings-as-errors=*" ..
- ninja
- ctest --output-on-failure
......
......@@ -4,7 +4,7 @@
* Copyright (C) 2014, 2015 Hans-Peter Deifel <hpdeifel@gmx.de>
* Copyright (C) 2015, Tamas Szekeres <szekerest@gmail.com>
* Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com>
* Copyright (C) 2018, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2018, 2020, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2018 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
* Copyright (C) 2018, 2020, Adam Reichold <adam.reichold@t-online.de>
*
......@@ -309,7 +309,8 @@ ustring ustring::from_latin1(const std::string &str)
const char *c = str.data();
ustring ret(l, 0);
for (size_type i = 0; i < l; ++i) {
ret[i] = *c++;
ret[i] = static_cast<unsigned char>(*c);
c++;
}
return ret;
}
......
......@@ -62,13 +62,13 @@ struct CharCodeToUnicodeString
static int getCharFromString(void *data)
{
char *p;
unsigned char *p;
int c;
p = *(char **)data;
p = *(unsigned char **)data;
if (*p) {
c = *p++;
*(char **)data = p;
*(unsigned char **)data = p;
} else {
c = EOF;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment