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

Jit: remove warning -Winvalid-offsetof #8687

Open
wants to merge 1 commit into
base: master
from

Conversation

@howard0su
Copy link
Contributor

howard0su commented Mar 23, 2020

Remove the warning:
warning: offsetof within non-standard-layout type ‘JitBlock’ is conditionally-supported
JitBlock contains non-trival types now. Split the fields with trival
types that needs to be access from JIT code into JitBlockData structure.

@BhaaLseN

This comment has been minimized.

Copy link
Member

BhaaLseN commented Mar 23, 2020

You should probably leave a comment next to JitBlockData that it exists to be a trivial type, and should stay that way. Otherwise we might run into a situation where this happens again or the two are merged (when someone doesn't know about this)

@lioncash

This comment has been minimized.

Copy link
Member

lioncash commented Mar 23, 2020

Even better yet, add:

static_assert(std::is_standard_layout_v<JitBlockData>, "JitBlockData must have a standard layout");

underneath its definition to enforce it at compile-time.

@howard0su

This comment has been minimized.

Copy link
Contributor Author

howard0su commented Mar 24, 2020

My goal is to enable "warning as error" at the near future as well. So that we don't regress.

@howard0su howard0su force-pushed the howard0su:warning_jitblock branch from 783812c to f01bf9b Mar 24, 2020
@CookiePLMonster

This comment has been minimized.

Copy link
Contributor

CookiePLMonster commented Mar 27, 2020

LGTM once lint issues get fixed.

Remove the warning:
warning: offsetof within non-standard-layout type ‘JitBlock’ is conditionally-supported
JitBlock contains non-trival types now. Split the fields with trival
types that needs to be access from JIT code into JitBlockData structure.
@howard0su howard0su force-pushed the howard0su:warning_jitblock branch from f01bf9b to 1209b80 Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.