Skip to content

Commit 8ec08a8

Browse files
committed
gcc15 fix.
1 parent 30164a9 commit 8ec08a8

11 files changed

Lines changed: 29 additions & 64 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,7 @@ Makefile
375375

376376
*.vcxproj
377377
*.vcxproj.filters
378-
*.sln
378+
*.sln
379+
380+
sigma.make
381+
tests.make

premake5.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ workspace "sigma"
1111
"MultiProcessorCompile"
1212
}
1313

14+
disablewarnings {
15+
"missing-field-initializers",
16+
"changes-meaning"
17+
}
18+
1419
-- buildoptions { "-fsanitize=address" }
1520
-- linkoptions { "-fsanitize=address" }
1621
-- debugformat "C7"
@@ -261,4 +266,4 @@ project "tests"
261266

262267
linkoptions {
263268
"-lstdc++"
264-
}
269+
}

source/compiler/compiler/diagnostics.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ namespace sigma {
6666
*/
6767
template<typename... arguments>
6868
static auto emit(code code, handle<token_location> location, arguments&&... args) -> utility::error {
69-
const std::string message = std::vformat(
70-
m_errors.find(code)->second,
71-
std::make_format_args(std::forward<arguments>(args)...)
72-
);
69+
auto arg_tuple = std::make_tuple(args...);
70+
const std::string message = std::apply([&](auto&... vals) {
71+
return std::vformat(m_errors.find(code)->second, std::make_format_args(vals...));
72+
}, arg_tuple);
7373

7474
const std::string error_message = std::format(
7575
"{}:{}:{}: error C{}: {}",
@@ -79,7 +79,6 @@ namespace sigma {
7979
static_cast<u32>(code),
8080
message
8181
);
82-
8382
return { error_message };
8483
}
8584

@@ -92,16 +91,15 @@ namespace sigma {
9291
*/
9392
template<typename... arguments>
9493
static auto emit(code code, arguments&&... args) -> utility::error {
95-
const std::string message = std::vformat(
96-
m_errors.find(code)->second,
97-
std::make_format_args(std::forward<arguments>(args)...)
98-
);
94+
auto arg_tuple = std::make_tuple(args...);
95+
const std::string message = std::apply([&](auto&... vals) {
96+
return std::vformat(m_errors.find(code)->second, std::make_format_args(vals...));
97+
}, arg_tuple);
9998

10099
const std::string error_message = std::format(
101100
"error C{}: {}",
102101
static_cast<u32>(code), message
103102
);
104-
105103
return { error_message };
106104
}
107105
private:
@@ -165,15 +163,19 @@ namespace sigma {
165163

166164
template<typename... arguments>
167165
static void emit(code code, handle<token_location> location, arguments&&... args) {
168-
auto formatted_args = std::make_format_args(std::forward<arguments>(args)...);
169-
std::string message = std::vformat(m_warnings.find(code)->second, formatted_args);
166+
auto arg_tuple = std::make_tuple(args...);
167+
std::string message = std::apply([&](auto&... vals) {
168+
return std::vformat(m_warnings.find(code)->second, std::make_format_args(vals...));
169+
}, arg_tuple);
170+
170171
utility::console::print(
171172
"{}:{}:{}: warning C{}: {}\n",
172173
location->file->get_filename(),
173174
location->line_index + 1,
174175
location->char_index + 1,
175176
static_cast<u32>(code),
176-
message);
177+
message
178+
);
177179
}
178180
private:
179181
const static inline std::unordered_map<code, std::string> m_warnings = {

source/compiler/compiler/type_system/type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace sigma {
8080
}
8181

8282
switch (ty.get_kind()) {
83-
case type::VOID: PANIC("cannot dereference a void*");
83+
case type::VOID: PANIC("cannot dereference a void*"); break;
8484
case type::I8:
8585
case type::I16:
8686
case type::U8:

source/compiler/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ i32 show_docs(const parametric::parameters& params) {
3636
return 0;
3737
}
3838

39-
std::cout << std::format("error: unable to open the documentation link ({})\n", link);
39+
std::cerr << std::format("error: unable to open the documentation link ({})\n", link);
4040
return 1;
4141
}
4242

source/parametric

source/utility

tests/functions/7_parameters.s

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/functions/7_parameters_expected.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/structs/pass_by_value_nested.s

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)