Commit eb195d46 authored by Bednárek David RNDr. Ph.D.'s avatar Bednárek David RNDr. Ph.D.
Browse files

g++ -Wall switched on

parent e4d7ea34
......@@ -62,6 +62,8 @@ function(COMMON_OPTIONS TARGET)
# message("LLVM_LIBS_USED = ${LLVM_LIBS_USED}")
target_link_libraries(${TARGET} PUBLIC ${LLVM_LIBS_USED})
endif()
SET_TARGET_OPTIONS(${TARGET} "-Wall" "")
SET_TARGET_OPTIONS(${TARGET} "" "/D_CRT_SECURE_NO_WARNINGS")
SET_TARGET_OPTIONS(${TARGET} "" "/D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING")
SET_TARGET_OPTIONS(${TARGET} "" "/wd4005")
......
......@@ -36,7 +36,7 @@ extern "C" {
}
else
{
auto rsize = rv2 + 1; // ending zero
auto rsize = (std::size_t)rv2 + 1; // ending zero
if (rsize >= buffer.size())
buffer.resize(rsize);
auto rv = std::vsnprintf(buffer.data(), buffer.size(), s, va);
......
......@@ -17,7 +17,7 @@ namespace cecko {
++aix;
return val;
}
if (aix + 1 < argc)
if (aix + 1 < (std::size_t)argc)
{
auto val = std::string(argv[aix + 1]);
aix += 2;
......@@ -26,7 +26,7 @@ namespace cecko {
return std::string();
};
while (aix < argc && (apos > 0 || argv[aix][0] == '-'))
while (aix < (std::size_t)argc && (apos > 0 || argv[aix][0] == '-'))
{
// skip '-' if necessary
if (apos == 0 && argv[aix][0] == '-')
......@@ -49,7 +49,7 @@ namespace cecko {
}
}
if (aix >= argc)
if (aix >= (std::size_t)argc)
{
std::cout << "cecko <input file>" << std::endl;
return false;
......
......@@ -496,10 +496,10 @@ namespace cecko {
CKTables::CKTables(CKIREnvironmentObs irenv)
: irenv_(irenv),
typetable_(irenv->context()),
globtable_(),
module_(irenv->module()),
data_layout_(irenv->data_layout())
data_layout_(irenv->data_layout()),
typetable_(irenv->context()),
globtable_()
{
declare_library();
}
......@@ -523,8 +523,8 @@ namespace cecko {
CKContext::CKContext(CKTablesObs tab)
: typetable_(tab->typetable()),
globtable_(tab->globtable()),
loctable_(nullptr),
module_(tab->module()),
loctable_(nullptr),
current_function_(nullptr),
current_function_ir_(nullptr),
alloca_builder_(tab->module()->getContext()),
......@@ -681,7 +681,7 @@ namespace cecko {
auto t_char = typetable_.get_char_type();
auto t_int = typetable_.get_int_type();
auto t_ptr_void = typetable_.get_pointer_type({ t_void, false });
auto t_cptr_void = typetable_.get_pointer_type({ t_void, true });
//auto t_cptr_void = typetable_.get_pointer_type({ t_void, true });
auto t_ptr_char = typetable_.get_pointer_type({ t_char, false });
auto t_cptr_char = typetable_.get_pointer_type({ t_char, true });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment