Skip to content

Commit

Permalink
Merge pull request #577 from ethereum/warnings
Browse files Browse the repository at this point in the history
Add stricter settings for warnings
  • Loading branch information
axic authored Mar 23, 2021
2 parents 9bf701b + 5794a34 commit 1132bd6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions examples/example_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace evmc
{
struct account
{
virtual ~account() = default;

evmc::uint256be balance = {};
std::vector<uint8_t> code;
std::map<evmc::bytes32, evmc::bytes32> storage;
Expand Down
6 changes: 3 additions & 3 deletions include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <stddef.h> /* Definition of size_t. */
#include <stdint.h> /* Definition of int64_t, uint64_t. */

#if __cplusplus
#ifdef __cplusplus
extern "C" {
#endif

Expand Down Expand Up @@ -917,7 +917,7 @@ struct evmc_vm

/* END Python CFFI declarations */

#if EVMC_DOCUMENTATION
#ifdef EVMC_DOCUMENTATION
/**
* Example of a function creating an instance of an example EVM implementation.
*
Expand All @@ -936,7 +936,7 @@ struct evmc_vm
struct evmc_vm* evmc_create_example_vm(void);
#endif

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/evmc/instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <evmc/evmc.h>
#include <evmc/utils.h>

#if __cplusplus
#ifdef __cplusplus
extern "C" {
#endif

Expand Down Expand Up @@ -219,7 +219,7 @@ EVMC_EXPORT const struct evmc_instruction_metrics* evmc_get_instruction_metrics_
*/
EVMC_EXPORT const char* const* evmc_get_instruction_names_table(enum evmc_revision revision);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions include/evmc/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
#pragma once

#if __cplusplus
#ifdef __cplusplus
extern "C" {
#endif

Expand Down Expand Up @@ -161,9 +161,9 @@ struct evmc_vm* evmc_load_and_configure(const char* config,
* @return Error message or NULL if no additional information is available.
* The returned pointer MUST NOT be freed by the caller.
*/
const char* evmc_last_error_msg();
const char* evmc_last_error_msg(void);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/evmc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @def EVMC_NOEXCEPT
* Safe way of marking a function with `noexcept` C++ specifier.
*/
#if __cplusplus
#ifdef __cplusplus
#define EVMC_NOEXCEPT noexcept
#else
#define EVMC_NOEXCEPT
Expand Down
4 changes: 2 additions & 2 deletions lib/loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#if defined(EVMC_LOADER_MOCK)
#include "../../test/unittests/loader_mock.h"
#elif _WIN32
#elif defined(_WIN32)
#include <Windows.h>
#define DLL_HANDLE HMODULE
#define DLL_OPEN(filename) LoadLibrary(filename)
Expand Down Expand Up @@ -136,7 +136,7 @@ evmc_create_fn evmc_load(const char* filename, enum evmc_loader_error_code* erro

// Find filename in the path.
const char* sep_pos = strrchr(filename, '/');
#if _WIN32
#ifdef _WIN32
// On Windows check also Windows classic path separator.
const char* sep_pos_windows = strrchr(filename, '\\');
sep_pos = sep_pos_windows > sep_pos ? sep_pos_windows : sep_pos;
Expand Down

0 comments on commit 1132bd6

Please sign in to comment.