Skip to content

Commit adae4a5

Browse files
authored
Tidy for basic, nobuiltins, add a basic headers check (#7117)
1 parent ae30a60 commit adae4a5

File tree

18 files changed

+191
-211
lines changed

18 files changed

+191
-211
lines changed

.clang-tidy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Checks: >
4545
-cppcoreguidelines-pro-type-vararg,
4646
-misc-no-recursion,
4747
-cert-dcl50-cpp,
48-
-performance-no-int-to-ptr
48+
-performance-no-int-to-ptr,
49+
-clang-analyzer-optin.cplusplus.VirtualCall,
50+
-cppcoreguidelines-rvalue-reference-param-not-moved
4951
5052
WarningsAsErrors: '*'
5153
HeaderFilterRegex: '?!(3rdparty)'

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1414
- CCF no longer has platform-specific builds. The single build configuration will run on both SNP and Virtual, automatically detecting the current platform at runtime. This means the `COMPILE_TARGET` CMake option is no longer required, and all release artifacts no longer have a platform in their path.
1515
- The `logging.host_level` configuration option and `--enclave-log-level` CLI switch are replaced by a combined `--log-level` CLI switch (#7104).
1616

17+
### Removed
18+
19+
- The `ccf/pal/hardware_info.h` header has been removed (#7117).
20+
1721
## [7.0.0-dev0]
1822

1923
[7.0.0-dev0]: https://github.com/microsoft/CCF/releases/tag/ccf-7.0.0-dev0

CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ list(APPEND CCHOST_SOURCES ${CCF_DIR}/src/host/main.cpp
249249

250250
add_executable(cchost ${CCHOST_SOURCES})
251251

252-
add_warning_checks(cchost)
253252
add_san(cchost)
254253
add_tidy(cchost)
254+
add_warning_checks(cchost)
255255

256256
target_compile_options(
257257
cchost PRIVATE ${COMPILE_LIBCXX} ${SNMALLOC_COMPILE_OPTIONS}
@@ -310,11 +310,13 @@ set(CCF_JS_SOURCES
310310
)
311311

312312
add_host_library(ccf_js "${CCF_JS_SOURCES}")
313+
313314
add_san(ccf_js)
314315
add_tidy(ccf_js)
316+
add_warning_checks(ccf_js)
317+
315318
target_link_libraries(ccf_js PUBLIC ccfcrypto quickjs)
316319
target_compile_definitions(ccf_js PRIVATE CCF_LOGGER_NO_DEPRECATE)
317-
add_warning_checks(ccf_js)
318320
if(CCF_DEVEL)
319321
install(
320322
TARGETS ccf_js
@@ -330,9 +332,11 @@ set(CCF_KV_SOURCES
330332
)
331333

332334
add_host_library(ccf_kv "${CCF_KV_SOURCES}")
335+
333336
add_san(ccf_kv)
334-
add_warning_checks(ccf_kv)
335337
add_tidy(ccf_kv)
338+
add_warning_checks(ccf_kv)
339+
336340
target_compile_definitions(ccf_kv PRIVATE CCF_LOGGER_NO_DEPRECATE)
337341
if(CCF_DEVEL)
338342
install(
@@ -345,12 +349,14 @@ endif()
345349
# CCF endpoints lib
346350
add_host_library(ccf_endpoints "${CCF_ENDPOINTS_SOURCES}")
347351
target_include_directories(ccf_endpoints PRIVATE ${CCF_DIR}/src/endpoints)
348-
add_tidy(ccf_endpoints)
349352
target_link_libraries(
350353
ccf_endpoints PUBLIC qcbor t_cose http_parser ccfcrypto ccf_kv
351354
)
355+
352356
add_san(ccf_endpoints)
357+
add_tidy(ccf_endpoints)
353358
add_warning_checks(ccf_endpoints)
359+
354360
target_compile_definitions(ccf_endpoints PRIVATE CCF_LOGGER_NO_DEPRECATE)
355361
if(CCF_DEVEL)
356362
install(
@@ -464,7 +470,6 @@ add_library(ccf STATIC ${CCF_IMPL_SOURCE})
464470
target_compile_definitions(ccf PUBLIC INSIDE_ENCLAVE VIRTUAL_ENCLAVE)
465471

466472
target_compile_options(ccf PUBLIC ${COMPILE_LIBCXX})
467-
add_warning_checks(ccf)
468473
target_compile_definitions(ccf PRIVATE CCF_LOGGER_NO_DEPRECATE)
469474

470475
target_include_directories(
@@ -490,8 +495,10 @@ target_link_libraries(
490495
)
491496

492497
set_property(TARGET ccf PROPERTY POSITION_INDEPENDENT_CODE ON)
498+
493499
add_san(ccf)
494500
add_tidy(ccf)
501+
add_warning_checks(ccf)
495502

496503
if(CCF_DEVEL)
497504
install(

cmake/ccf_app.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function(add_ccf_app name)
4444
set_property(TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON)
4545

4646
add_san(${name})
47+
add_tidy(${name})
4748

4849
add_dependencies(${name} ${name})
4950
if(PARSED_ARGS_DEPS)

include/ccf/ds/json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ namespace std
412412
} \
413413
catch (ccf::JsonParseError & jpe) \
414414
{ \
415-
jpe.pointer_elements.push_back(JSON_FIELD); \
415+
jpe.pointer_elements.emplace_back(JSON_FIELD); \
416416
throw; \
417417
} \
418418
}

include/ccf/pal/hardware_info.h

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

include/ccf/research/create_tx_claims_digest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ namespace ccf
1313
* @return an optional claims digest
1414
*/
1515
std::optional<ccf::ClaimsDigest::Digest> get_create_tx_claims_digest(
16-
ccf::kv::ReadOnlyTx& tx)
16+
ccf::kv::ReadOnlyTx& tx);
1717
}

samples/apps/basic/basic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace basicapp
4545
return;
4646
}
4747

48-
auto records_handle = ctx.tx.template rw<RecordsMap>(PRIVATE_RECORDS);
48+
auto* records_handle = ctx.tx.template rw<RecordsMap>(PRIVATE_RECORDS);
4949
records_handle->put(key, ctx.rpc_ctx->get_request_body());
5050
ctx.rpc_ctx->set_response_status(HTTP_STATUS_NO_CONTENT);
5151
};
@@ -67,7 +67,7 @@ namespace basicapp
6767
return;
6868
}
6969

70-
auto records_handle = ctx.tx.template ro<RecordsMap>(PRIVATE_RECORDS);
70+
auto* records_handle = ctx.tx.template ro<RecordsMap>(PRIVATE_RECORDS);
7171
auto record = records_handle->get(key);
7272

7373
if (record.has_value())
@@ -96,7 +96,7 @@ namespace basicapp
9696

9797
const auto records = body.get<std::map<std::string, std::string>>();
9898

99-
auto records_handle = ctx.tx.template rw<RecordsMap>(PRIVATE_RECORDS);
99+
auto* records_handle = ctx.tx.template rw<RecordsMap>(PRIVATE_RECORDS);
100100
for (const auto& [key, value] : records)
101101
{
102102
const std::vector<uint8_t> value_vec(value.begin(), value.end());

0 commit comments

Comments
 (0)