Skip to content

Commit bcdb641

Browse files
fix(build): support the latest version of gcc (#597)
### What problem were solved in this pull request? When compiling MiniOB with a newer version of GCC (I use 15.1.1), a series of compilation errors may occur. This is mainly because the new version of the compiler has stricter standards for header file inclusion and namespace usage. Issue Number: close None Problem: Some source files use algorithm functions like `std::sort` or `std::for_each` but do not include the `<algorithm>` header file. ### What is changed and how it works? Added `#include <algorithm>` in all C++ source files that use `std::sort` and `std::for_each`. ### Other information Tests show that after applying these modifications, the project can be successfully compiled in the GCC 15.1.1 environment.
1 parent 90d6851 commit bcdb641

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/observer/sql/optimizer/cascade/tasks/o_expr_task.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See the Mulan PSL v2 for more details. */
1414
#include "sql/optimizer/cascade/group_expr.h"
1515
#include "sql/optimizer/cascade/memo.h"
1616
#include "common/log/log.h"
17+
#include <algorithm>
1718

1819
void OptimizeExpression::perform()
1920
{
@@ -57,4 +58,4 @@ void OptimizeExpression::perform()
5758
child_group_idx++;
5859
}
5960
}
60-
}
61+
}

src/observer/storage/buffer/double_write_buffer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ See the Mulan PSL v2 for more details. */
1818
#include "common/io/io.h"
1919
#include "common/log/log.h"
2020
#include "common/math/crc.h"
21+
#include <algorithm>
2122

2223
using namespace common;
2324

src/observer/storage/common/codec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ See the Mulan PSL v2 for more details. */
1818
#include "common/sys/rc.h"
1919
#include "common/value.h"
2020
#include <cstring>
21+
#include <algorithm>
2122

2223
using byte_t = unsigned char;
2324
using bytes = vector<byte_t>;

0 commit comments

Comments
 (0)