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

Add missing mode initializers to socket function pointer structs #1857

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

MasterDuke17
Copy link
Contributor

I think these were missed in #1803.

This fixes the three compiler warnings like the example below:

src/io/asyncsocketudp.c:467:57: warning: missing initializer for field ‘mvm_open_mode’ of ‘MVMIOIntrospection’ [-Wmissing-field-initializers]
  467 |                                                         socket_handle };
      |                                                         ^~~~~~~~~~~~~
In file included from src/moar.h:279,
                 from src/io/asyncsocketudp.c:1:
src/io/io.h:86:16: note: ‘mvm_open_mode’ declared here
   86 |     MVMint64 (*mvm_open_mode) (MVMThreadContext *tc, MVMOSHandle *h);
      |                ^~~~~~~~~~~~~

I believe putting NULL is safe because of the check here https://github.com/MoarVM/MoarVM/blob/main/src/disp/syscall.c#L1277.

I think these were missed in MoarVM#1803.

This fixes the three compiler warnings like the example below:
```
src/io/asyncsocketudp.c:467:57: warning: missing initializer for field ‘mvm_open_mode’ of ‘MVMIOIntrospection’ [-Wmissing-field-initializers]
  467 |                                                         socket_handle };
      |                                                         ^~~~~~~~~~~~~
In file included from src/moar.h:279,
                 from src/io/asyncsocketudp.c:1:
src/io/io.h:86:16: note: ‘mvm_open_mode’ declared here
   86 |     MVMint64 (*mvm_open_mode) (MVMThreadContext *tc, MVMOSHandle *h);
      |                ^~~~~~~~~~~~~
```

I believe putting NULL is safe because of the check here
https://github.com/MoarVM/MoarVM/blob/main/src/disp/syscall.c#L1277.
@MasterDuke17 MasterDuke17 merged commit bfa7a23 into MoarVM:main Nov 11, 2024
23 checks passed
@MasterDuke17 MasterDuke17 deleted the add_missing_initializers branch November 11, 2024 19:59
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.

2 participants