mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-13 21:21:22 +00:00
Clear compilation warning and dead code (#3002)
This commit is contained in:
parent
63012f0222
commit
23d2e0627c
|
@ -25,6 +25,7 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
|
||||||
static bool
|
static bool
|
||||||
check_utf8_str(const uint8 *str, uint32 len)
|
check_utf8_str(const uint8 *str, uint32 len)
|
||||||
{
|
{
|
||||||
|
@ -89,6 +90,7 @@ check_utf8_str(const uint8 *str, uint32 len)
|
||||||
}
|
}
|
||||||
return (p == p_end);
|
return (p == p_end);
|
||||||
}
|
}
|
||||||
|
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION != 0 */
|
||||||
|
|
||||||
/* Internal function in object file */
|
/* Internal function in object file */
|
||||||
typedef struct AOTObjectFunc {
|
typedef struct AOTObjectFunc {
|
||||||
|
@ -1111,6 +1113,7 @@ static union {
|
||||||
EMIT_BUF(s, str_len); \
|
EMIT_BUF(s, str_len); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
|
||||||
static bool
|
static bool
|
||||||
read_leb(uint8 **p_buf, const uint8 *buf_end, uint32 maxbits, bool sign,
|
read_leb(uint8 **p_buf, const uint8 *buf_end, uint32 maxbits, bool sign,
|
||||||
uint64 *p_result)
|
uint64 *p_result)
|
||||||
|
@ -1309,6 +1312,7 @@ get_name_section_size(AOTCompData *comp_data)
|
||||||
fail:
|
fail:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION != 0 */
|
||||||
|
|
||||||
static uint32
|
static uint32
|
||||||
get_custom_sections_size(AOTCompContext *comp_ctx, AOTCompData *comp_data)
|
get_custom_sections_size(AOTCompContext *comp_ctx, AOTCompData *comp_data)
|
||||||
|
@ -2065,6 +2069,7 @@ aot_emit_native_symbol(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
|
||||||
static bool
|
static bool
|
||||||
aot_emit_name_section(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
aot_emit_name_section(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
||||||
AOTCompData *comp_data, AOTCompContext *comp_ctx)
|
AOTCompData *comp_data, AOTCompContext *comp_ctx)
|
||||||
|
@ -2090,6 +2095,7 @@ aot_emit_name_section(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
||||||
LOG_DEBUG("emit name section");
|
LOG_DEBUG("emit name section");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
aot_emit_custom_sections(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
aot_emit_custom_sections(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
||||||
|
|
|
@ -4046,15 +4046,6 @@ check_wasi_abi_compatibility(const WASMModule *module,
|
||||||
* according to the assumption, they should be all wasi compatiable
|
* according to the assumption, they should be all wasi compatiable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* always can not have both at the same time */
|
|
||||||
if (start && initialize) {
|
|
||||||
set_error_buf(
|
|
||||||
error_buf, error_buf_size,
|
|
||||||
"neither a command nor a reactor can both have _start function "
|
|
||||||
"and _initialize function at the same time");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if WASM_ENABLE_MULTI_MODULE != 0
|
#if WASM_ENABLE_MULTI_MODULE != 0
|
||||||
/* filter out commands (with `_start`) cases */
|
/* filter out commands (with `_start`) cases */
|
||||||
if (start && !main_module) {
|
if (start && !main_module) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user