Removed -pthread and -fno-strict-aliasing flags

This commit is contained in:
Bob Polis 2021-11-13 19:14:02 +01:00
parent 8eba81ca4b
commit e7979589ee
3 changed files with 28 additions and 16 deletions

View File

@ -28,7 +28,7 @@ HDRS := $(filter-out $(LIBNAME).hpp,$(wildcard *.hpp))
CXX ?= g++ CXX ?= g++
CXXFLAGS := $(CXXFLAGS) -Wshadow -Wall -Wpedantic -Wextra -g -fno-strict-aliasing -std=c++17 -fPIC CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -g -std=c++17 -fPIC
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CXXFLAGS += -D DEBUG -O0 CXXFLAGS += -D DEBUG -O0
else else

View File

@ -11,7 +11,10 @@
using namespace std; using namespace std;
static string combine_message_elements(const char* file, unsigned int line, const char* user_message, const char* sys_message) static string combine_message_elements(const char* file,
unsigned int line,
const char* user_message,
const char* sys_message)
{ {
ostringstream msg; ostringstream msg;
string f {file}; string f {file};
@ -22,7 +25,10 @@ static string combine_message_elements(const char* file, unsigned int line, cons
return msg.str(); return msg.str();
} }
void __throw_if_min1(int x, const char* file, unsigned int line, const char* message) void __throw_if_min1(int x,
const char* file,
unsigned int line,
const char* message)
{ {
if (x == -1) { if (x == -1) {
error_code ec {errno, system_category()}; error_code ec {errno, system_category()};
@ -33,7 +39,10 @@ void __throw_if_min1(int x, const char* file, unsigned int line, const char* mes
} }
} }
void __throw_if_null(const void* p, const char* file, unsigned int line, const char* message) void __throw_if_null(const void* p,
const char* file,
unsigned int line,
const char* message)
{ {
if (p == nullptr) { if (p == nullptr) {
string msg {combine_message_elements(file, line, message, "null pointer exception")}; string msg {combine_message_elements(file, line, message, "null pointer exception")};
@ -41,7 +50,10 @@ void __throw_if_null(const void* p, const char* file, unsigned int line, const c
} }
} }
void __throw_if_err(int err, const char* file, unsigned int line, const char* message) void __throw_if_err(int err,
const char* file,
unsigned int line,
const char* message)
{ {
if (err != 0) { if (err != 0) {
error_code ec {err, system_category()}; error_code ec {err, system_category()};

View File

@ -1,6 +1,6 @@
// throw macros for OS X and other POSIX systems // throw macros for OS X and other POSIX systems
// adapted for Windows as well, november 2014 // adapted for Windows as well, november 2014
// copyright © 2002-2014 Bob Polis // copyright © 2002-2022 Bob Polis
#ifndef __throw__ #ifndef __throw__
#define __throw__ #define __throw__