Skip to content

cleanup to allow binaryen to be built in more strict environments#3566

Merged
tlively merged 6 commits into
WebAssembly:mainfrom
walkingeyerobot:main
Feb 16, 2021
Merged

cleanup to allow binaryen to be built in more strict environments#3566
tlively merged 6 commits into
WebAssembly:mainfrom
walkingeyerobot:main

Conversation

@walkingeyerobot

Copy link
Copy Markdown
Contributor

No description provided.

return ASM_UNSIGNED;
}
} // fallthrough
[[fallthrough]];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which compilers does this work? A search suggests it's standardized in C++17, but maybe it was supported earlier?

And specifically, does it work in MSVC?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the ability to build with MSVC at the moment, but it looks like it should be supported according to this page: https://docs.microsoft.com/en-us/cpp/cpp/attributes?view=msvc-160

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It says VS2017+, but our docs on the readme page mention 2015. But maybe we can just update that to 2017?

Looks like emscripten CI uses 2019, so no issues there.

Comment thread src/passes/OptimizeInstructions.cpp Outdated
}
default: {
}
default: { break; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the default really need a break if there is nothing after it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one is not necessary, but the one above it is. I added it for clarity, but I'm happy to remove it if you'd prefer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I think a break on the last item is more confusing actually. So I'd prefer to remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread src/wasm2js.h
@tlively

tlively commented Feb 12, 2021

Copy link
Copy Markdown
Member

What are the strict environments in question here? If we can't reproduce these errors on our CI, we will probably introduce new regressions in the future.

@kripken

kripken commented Feb 13, 2021

Copy link
Copy Markdown
Member

I'm not sure if we have a place to mention a requirement for VS2017+. The readme mentions 2015 but I see it's in a link to other instructions. So maybe the docs are ok as they are.

@tlively I think we are already building with -Wall -Werror, so we are already maxing out the compilers here?

@walkingeyerobot

Copy link
Copy Markdown
Contributor Author

There are some checks I can add to CMakeLists.txt. I'll add those and re-ping.

@walkingeyerobot

Copy link
Copy Markdown
Contributor Author

I added two additional warnings, -Wimplicit-fallthrough and -Wnon-virtual-dtor, neither of which are enabled by -Wall -Wextra. However, when I intentionally caused an error with these flags on, in addition to the correct error message, I also got this:

cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-implicit-int-float-conversion’ [-Werror]

Those messages don't show up when the build passes. I'm not sure why that happens, or the best way to make these go away. If what I have is wrong please let me know.

@tlively tlively left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'm not too worried about extra errors that show up only in conjunction with correct errors, although that is strange.

@walkingeyerobot

Copy link
Copy Markdown
Contributor Author

Is this all set to be merged? Thanks!

@tlively tlively merged commit a74bc72 into WebAssembly:main Feb 16, 2021
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

Successfully merging this pull request may close these issues.

3 participants