Skip to content

Commit

Permalink
--mingw/SUSUWU_WIN32 regression fix, typos fix
Browse files Browse the repository at this point in the history
?`cxx/ClassSys.cxx`: `SUSUWU_WIN32` regression fix.
	`classSysHexStrTests`: `error: use of undeclared identifier 'SUSUWU_SH_0'` fix.
	Is followup to: e4dadb1 (?`classSysHexOs`: 2 hexits per char (logic fix):), which introduced +`classSysHexStrTests` (which caused the regression, due to use of `ERROR`).
	TODO: remove `ERROR` (since it conflicts with `#include <shlobj.h>` on _WIN32.) Is more complex than it sounds.

?`cxx/ClassResultList.cxx`: `clang-tidy` fix:
	`warning: #includes are not sorted properly [llvm-include-order]` fix.
	Is followup to: d7370e8 (undo C++14 code, support `-std=c++11` ...+`#include <string>`).

?`build.sh`: typo fixes
	`:%s/"\`${SOURCE}\` is newer than \`${OBJECT}\`, will rebuild"/"\`${SOURCE}\` (which is a common `#include`) is newer than \`${OBJECT}\`, will rebuild"/`: message now gives reason that condition results in `--rebuild`.
	`:%s/intermediate objects+ continue/intermediate objects + continue/`: typo fix.
	Is followup to: 2a6e624 (?`build.sh`: incremental builds (reuse objects),
  • Loading branch information
SwuduSusuwu committed Nov 18, 2024
1 parent 4920b4a commit f2cf644
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fi

CXXFLAGS_ANALYSIS="-Wall -Wno-unused -Wno-unused-function -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers" #/*TODO: -`-Wno-*`, +`-Wpedantic`, +`-Werror` */
CXXFLAGS_RELEASE="-fomit-frame-pointer -DNDEBUG -O2" #/* without frame pointer (pointer used for stacktraces), without `assert(...)`/`SUSUWU_DEBUG(...)`/`SUSUWU_NOTICE(...)`, with optimization level 2 */
CXXFLAGS_DEBUG="-std=c++11 -g -Og" #/* in MSVC is `/Zi /Od`: symbols for `gdb`/`lldb` use, optimizations compatible with `-g`/`-fsan*` */
CXXFLAGS_DEBUG="-g -Og" #/* in MSVC is `/Zi /Od`: symbols for `gdb`/`lldb` use, optimizations compatible with `-g`/`-fsan*` */
CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG} -fno-omit-frame-pointer" #/* thus optimization won't remove stacktraces: https://stackoverflow.com/questions/48234575/g-will-fno-omit-frame-pointer-be-effective-if-specified-before-o2-or-o3 https://clang.llvm.org/docs/MemorySanitizer.html */
#CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG} -fno-optimize-sibling-calls" #/* Don't inline functions. Does extra stacktraces. */
Expand Down Expand Up @@ -80,7 +81,7 @@ else
fi
mkdir -p "${OBJDIR}" "${BINDIR}"
if [ "--rebuild" = "${1}" -o "--rebuild" = "${2}" ]; then
SUSUWU_PRINT "${SUSUWU_SH_NOTICE}" "Was called with \`${0}${CROSS_COMP} --rebuild\`, will remove intermediate objects+ continue."
SUSUWU_PRINT "${SUSUWU_SH_NOTICE}" "Was called with \`${0}${CROSS_COMP} --rebuild\`, will remove intermediate objects + continue."
rm ${OBJDIR}*.o
fi
if [ "--clean" = "${1}" -o "--clean" = "${2}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion cxx/ClassResultList.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "ClassResultList.hxx" /* resultList resultListDumpTo ResultListHash */
#include "Macros.hxx" /* SUSUWU_ERRSTR SUSUWU_SH_GREEN SUSUWU_NOEXCEPT SUSUWU_SH_RED SUSUWU_SH_WHITE */
#include <sstream> /* std::stringstream */
#include <string> /* std::string */
#include <stdexcept> /* std::runtime_error */
#include <string> /* std::string */
namespace Susuwu {
static void classResultListDumpToTest(const ResultList &resultList, bool index, bool whitespace, bool pascalValues, const std::string &expectedValue) { /* NOLINT(misc-use-anonymous-namespace): have to call */
std::stringstream os;
Expand Down
4 changes: 3 additions & 1 deletion cxx/ClassSys.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ const int execves(const std::vector<std::string> &argvS, const std::vector<std::
return wstatus;
#else /* ndef SUSUWU_POSIX */
throw std::runtime_error(SUSUWU_ERRSTR(ERROR, "execves: {#ifndef SUSUWU_POSIX /* TODO: convert to win32 */}"));
# define ERROR 0 /* redo `shlobj.h`'s `#define ERROR 0` */
#endif /* ndef SUSUWU_POSIX */
}

Expand Down Expand Up @@ -162,6 +161,9 @@ static void classSysHexTests(const std::string &value) {
classSysHexOs(os, value);
if(2 != os.str().size()) {
throw std::runtime_error(SUSUWU_ERRSTR(ERROR, "classSysHexOs(os, value); " + std::to_string(value.size()) + " == value.size(); " + std::to_string(os.str().size()) + " == os.str().size();"));
#ifndef SUSUWU_POSIX
# define ERROR 0 /* redo `shlobj.h`'s `#define ERROR 0` */
#endif /* ndef SUSUWU_POSIX */
}
}
const bool classSysTests() {
Expand Down

0 comments on commit f2cf644

Please sign in to comment.