Removed -pthread and -fno-strict-aliasing flags
This commit is contained in:
parent
8eba81ca4b
commit
e7979589ee
2
Makefile
2
Makefile
@ -28,7 +28,7 @@ HDRS := $(filter-out $(LIBNAME).hpp,$(wildcard *.hpp))
|
||||
|
||||
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)
|
||||
CXXFLAGS += -D DEBUG -O0
|
||||
else
|
||||
|
20
throw.cpp
20
throw.cpp
@ -11,7 +11,10 @@
|
||||
|
||||
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;
|
||||
string f {file};
|
||||
@ -22,7 +25,10 @@ static string combine_message_elements(const char* file, unsigned int line, cons
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
error_code ec {err, system_category()};
|
||||
|
Loading…
x
Reference in New Issue
Block a user