Skip to content
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

'isnanf' is invalid in C99 #11

Open
konsumer opened this issue Jan 25, 2023 · 2 comments
Open

'isnanf' is invalid in C99 #11

konsumer opened this issue Jan 25, 2023 · 2 comments

Comments

@konsumer
Copy link

on mac 13.0.1 intel, if I run make or make CC=gcc

I get this error:

main/miniwasm.c:127:73: error: implicit declaration of function 'isnanf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                                        if (data[n].f32 == expected || (isnanf(expected) && isnanf(data[n].f32))) {
                                                                        ^
1 error generated.
@konsumer
Copy link
Author

konsumer commented Jan 25, 2023

If I replace isnanf with isnan it seems to build, so I can add this (hacky) macro to top:

#ifdef __APPLE__
#define isnanf(f) isnan(f)
#endif

Should I PR for this?

Update I am seeing this on benchmark, so this is maybe not the right way: memmory access 0xffffffff of size 0x4 out of bounds:

RUN: #1
  TEST: trap
    ENGINE: wasm3
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
Error: [trap] out of bounds memory access
    ENGINE: /Users/konsumer/Downloads/Web49-main/bin/miniwasm
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds
memmory access 0xffffffff of size 0x4 out of bounds

It is only for wasm3, so maybe it's ok

@ShawSumma
Copy link
Member

It is invalid c99 but so is ({}) and my whole goto strategy, clang understands it as the implementation language is settable -std=gnu11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants