From ecbdc925d43f489e5c5b101900db88f9d260efe7 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 25 Jul 2019 13:40:42 -0700 Subject: 5476 Fix CI. Also kill compiler version mismatch bugs once and for all. --- subx/011run.cc | 8 +++++++- subx/030---operands.cc | 2 +- subx/build | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'subx') diff --git a/subx/011run.cc b/subx/011run.cc index ca568a98..cc3b82f6 100644 --- a/subx/011run.cc +++ b/subx/011run.cc @@ -300,7 +300,7 @@ const segment* find(const program& p, const string& segment_name) { } uint8_t hex_byte(const string& s) { - if (std::any_of(s.begin(), s.end(), isupper)) { + if (contains_uppercase(s)) { raise << "uppercase hex not allowed: " << s << '\n' << end(); return 0; } @@ -459,3 +459,9 @@ string to_string(const word& w) { out << " /" << w.metadata.at(i); return out.str(); } + +bool contains_uppercase(const string& s) { + for (int i = 0; i < SIZE(s); ++i) + if (isupper(s.at(i))) return true; + return false; +} diff --git a/subx/030---operands.cc b/subx/030---operands.cc index 8dc38542..9f40e949 100644 --- a/subx/030---operands.cc +++ b/subx/030---operands.cc @@ -503,7 +503,7 @@ string to_string(const line& inst) { int32_t parse_int(const string& s) { if (s.empty()) return 0; - if (std::any_of(s.begin(), s.end(), isupper)) { + if (contains_uppercase(s)) { raise << "uppercase hex not allowed: " << s << '\n' << end(); return 0; } diff --git a/subx/build b/subx/build index 8939c8b3..67479b92 100755 --- a/subx/build +++ b/subx/build @@ -21,7 +21,7 @@ UNTIL_LAYER=${2:-zzz} test "$CXX" || export CXX=c++ test "$CC" || export CC=cc -test "$CFLAGS" || export CFLAGS="-g -O3" +test "$CFLAGS" || export CFLAGS="-g -O3 -std=c++98" # CI has an ancient version; don't expect recent dialects export CFLAGS="$CFLAGS -Wall -Wextra -fno-strict-aliasing" # return 1 if $1 is older than _any_ of the remaining args -- cgit 1.4.1-2-gfad0