Skip to content

Commit 3879cef

Browse files
committed
Warnings as errors / Noop boost builds
Treat warnings as errors. Not running with this is a hacky artifact of hacky prototyping. Additionally noop boost build. It's annoying and slow for this to keep running. Don't do this where $CI ( travis sets this ).
1 parent e73402b commit 3879cef

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

APIIntegrationTests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ template <typename Success, typename Error>
2323
using Result = boost::variant<Success, Error>;
2424

2525
namespace ResultStatus {
26+
#pragma clang diagnostic push
27+
#pragma clang diagnostic ignored "-Wunused-variable"
2628
const int Ok = 0;
2729
const int Error = 1;
30+
#pragma clang diagnostic pop
2831

2932
template <typename T, typename R> auto Get(R v) {
3033
return boost::get<T>(v);

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ else()
8282
endif()
8383

8484
set(GLOBAL_CXX_FLAGS "-std=c++1z -stdlib=libc++")
85-
set(GLOBAL_CXX_FLAGS "${GLOBAL_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-unused-parameter")
85+
set(GLOBAL_CXX_FLAGS "${GLOBAL_CXX_FLAGS} -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter")
8686
set(GLOBAL_CXX_FLAGS "${GLOBAL_CXX_FLAGS} -Wno-import-preprocessor-directive-pedantic -Wno-unused-command-line-argument")
8787

8888
add_definitions(${GLOBAL_CXX_FLAGS})

SwiftCompleter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ using namespace ssvim;
261261
// it can be improved.
262262
static void GetOffset(CompletionContext &ctx, unsigned *offset,
263263
std::string *CleanFile) {
264-
unsigned line = ctx.line;
265-
unsigned column = ctx.column;
264+
auto line = ctx.line;
265+
auto column = ctx.column;
266266
auto fileName = ctx.sourceFilename;
267267

268268
std::string unsavedInput;
@@ -282,7 +282,7 @@ static void GetOffset(CompletionContext &ctx, unsigned *offset,
282282
while (std::getline(sourceFile, someLine)) {
283283
if (currentLine + 1 == line) {
284284
// Enumerate from the column to an interesting point
285-
for (int i = column; i >= 0; i--) {
285+
for (auto i = column;; i--) {
286286
char someChar = '\0';
287287
if (someLine.length() > i) {
288288
someChar = someLine.at(i);

build_boost.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ SSVIM_BUILD_DIR=$DIR/build
1212
BOOST_PREFIX=$SSVIM_BUILD_DIR/vendor/boost/
1313
BOOST_LIB_DIR=$SSVIM_BUILD_DIR/vendor/boost/lib/
1414

15+
if [[ -d $BOOST_LIB_DIR ]] && [[ -z $CI ]]; then
16+
echo "Boost probably is built, skipping"
17+
exit 0
18+
fi
19+
1520
mkdir -p $BOOST_LIB_DIR
1621

1722
# Wants to build from here.

0 commit comments

Comments
 (0)