-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabled clang compiler support #8
Conversation
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator> | ||
# 3. <Linux, Debug, latest GCC compiler toolchain on the default runner image, default generator> | ||
# 3. <Linux, Release, clang-15, default generator> | ||
# 3. <Linux, Debug, clang-15, default generator> | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have't noticed the numbers, so I have to fix here)
srcbpatch/binarylexeme.cpp
Outdated
@@ -20,7 +20,7 @@ const span<const char>& AbstractBinaryLexeme::Replace(size_t at, size_t alength, | |||
|
|||
unique_ptr<AbstractBinaryLexeme> AbstractBinaryLexeme::LexemeFromVector(vector<char>&& asrcVec) | |||
{ | |||
return unique_ptr<AbstractBinaryLexeme>(new AbstractBinaryLexeme(move(asrcVec))); | |||
return unique_ptr<AbstractBinaryLexeme>(new AbstractBinaryLexeme(std::move(asrcVec))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check Line 7 in this file:
this change is unnecessary
.gitignore
Outdated
@@ -6,6 +6,8 @@ buildWinRelease/ | |||
build/ | |||
.vscode/ | |||
x64/ | |||
.idea/ | |||
cmake-build-debug/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason of the "cmake-build-debug/" folder?
Take a look on the script rebuild.sh in the root of the project. run it on your mac - whether it will work?
(It is possible that this folder need to have another name.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use CLion ide and it contains this folders. So, it's just for simplify committing for me.
srcbpatch/binarylexeme.cpp
Outdated
@@ -51,7 +51,7 @@ unique_ptr<AbstractBinaryLexeme> AbstractBinaryLexeme::LexemeFromLexeme(unique_p | |||
|
|||
|
|||
AbstractBinaryLexeme::AbstractBinaryLexeme(vector<char>&& asrcVec) | |||
: dataSequence_(move(asrcVec)) | |||
: dataSequence_(std::move(asrcVec)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check Line 7 in this file:
this change is unnecessary
NOTE: why vector at line 53 is not with namespace
#include <ranges> | ||
#include <algorithm> | ||
#include <cstring> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "stdafx.h" from line 1
already contains these includes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it doesn't work for clang. I will send you proofs.
srcbpatch/fileprocessing.cpp
Outdated
@@ -1,6 +1,9 @@ | |||
#include "stdafx.h" | |||
#include "fileprocessing.h" | |||
|
|||
#include <ranges> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "stdafx.h" from line 1
already contains these includes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it doesn't work for clang. I will send you proofs.
srcbpatch/fileprocessing.cpp
Outdated
@@ -24,11 +27,15 @@ using namespace std::filesystem; | |||
|
|||
FileProcessing::FileProcessing(const char* fname, const char* mode) | |||
{ | |||
#pragma warning(disable: 4996) // I would like to use fopen instead of fopen_s, because | |||
#if !defined(__linux__) && !(defined(__APPLE__) && defined(__MACH__)) | |||
#pragma warning(disable: 4996) // I would like to use fopen instead of fopen_s, because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any precompile directives must be written from 1-st position (no indentation)
srcbpatch/fileprocessing.cpp
Outdated
if (stream_ = fopen(fname, mode); nullptr == stream_) | ||
#pragma warning(default: 4996) | ||
#if !defined(__linux__) && !(defined(__APPLE__) && defined(__MACH__)) | ||
#pragma warning(default: 4996) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any precompile directives must be written from 1-st position (no indentation)
srcbpatch/processing.cpp
Outdated
@@ -46,7 +46,7 @@ unique_ptr<ActionsCollection> CreateActionsFile(string_view actionsFileName) | |||
|
|||
// Parsing of todo and lexemes | |||
// Dictionary will be inside | |||
return unique_ptr<ActionsCollection>(new ActionsCollection(move(adata))); | |||
return unique_ptr<ActionsCollection>(new ActionsCollection(std::move(adata))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hardly believe that we need to use std::move near the usage of unique_ptr without std::
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will double check this moment
testbpatch/CMakeLists.txt
Outdated
@@ -2,6 +2,17 @@ cmake_minimum_required(VERSION 3.19) | |||
set(pname bpatch) | |||
project(test${pname}) | |||
|
|||
include(FetchContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was in the version because it is tagged and must work without possibility of harmful code injections
note: GIT_TAG below
##get google test
include(FetchContent)
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG release-1.12.1)
FetchContent_GetProperties(googletest)
#googletest_POPULATED
#googletest_SOURCE_DIR
#googletest_BUILD_DIR
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BUILD_DIR})
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use the code from official repo https://github.com/google/googletest/blob/main/googletest/README.md, so it's correct as well.
And I had some troubles with the existing code in clang. For some reason static libraries have been created in wrong directory so the cmake of testbpatch unable to find it.
testbpatch/CMakeLists.txt
Outdated
# For Windows: Prevent overriding the parent project's compiler/linker settings | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one new line between sections in CMakeLists.txt.
PS. remove line 20 below to follow this rule, please
wildcharacters/wildcharacters.cpp
Outdated
@@ -1,4 +1,5 @@ | |||
#include <filesystem> | |||
#include <sstream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason of this include is unclear.
justify or remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got compilation error using clang. It doesn't see sstream functions
- os: ubuntu-latest | ||
c_compiler: cl | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нет понимания почему тут поменялась 3 на 4.
расскажешь?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Просто вышла новая версия, а на эту кидает ворнинг, что она устарела.
- uses: actions/checkout@v4 | ||
|
||
- name: Install clang | ||
if: matrix.os=='ubuntu-latest' && matrix.c_compiler=='clang-15' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нет строк(и) комментария с описанием что происходит и почему это нужно
1e5beb6
to
b71e8b5
Compare
No description provided.