mirror of https://github.com/status-im/evmc.git
EVM-C: Build examples without #pragma warning suppressions
This commit is contained in:
parent
81edf123db
commit
e0ff4b350e
|
@ -1,3 +1,5 @@
|
|||
add_compile_options("-Wno-extra") # Override -Wextra, I don't know better option.
|
||||
|
||||
add_library(example-vm STATIC EXCLUDE_FROM_ALL examplevm.c)
|
||||
target_include_directories(example-vm PRIVATE ../include)
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include "evm.h"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
|
||||
struct evm_uint256 balance(struct evm_env* env, struct evm_hash160 address)
|
||||
{
|
||||
|
@ -86,8 +83,8 @@ int main(int argc, char *argv[]) {
|
|||
if (result.gas_left & EVM_EXCEPTION) {
|
||||
printf(" EVM eception\n");
|
||||
}
|
||||
printf(" Gas used: " PRId64 "\n", gas - result.gas_left);
|
||||
printf(" Gas left: " PRId64 "\n", result.gas_left);
|
||||
printf(" Gas used: %ld\n", gas - result.gas_left);
|
||||
printf(" Gas left: %ld\n", result.gas_left);
|
||||
printf(" Output size: %zd\n", result.output_size);
|
||||
|
||||
printf(" Output: ");
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
#include <stdbool.h>
|
||||
#include "evm.h"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
|
||||
struct evm_instance {
|
||||
evm_query_fn query_fn;
|
||||
evm_update_fn update_fn;
|
||||
|
@ -70,7 +67,11 @@ static void evm_release_result(struct evm_result const* result)
|
|||
|
||||
EXPORT struct evm_fn_table examplevm_get_fn_table()
|
||||
{
|
||||
struct evm_fn_table ftab = {evm_create, evm_destroy, evm_execute,
|
||||
evm_release_result, 0, 0, 0};
|
||||
struct evm_fn_table ftab;
|
||||
memset(&ftab, 0, sizeof(struct evm_result));
|
||||
ftab.create = evm_create;
|
||||
ftab.destroy = evm_destroy;
|
||||
ftab.execute = evm_execute;
|
||||
ftab.release_result = evm_release_result;
|
||||
return ftab;
|
||||
}
|
Loading…
Reference in New Issue