Skip to content

Commit 70e6622

Browse files
Merge pull request #976 from MisterDA/ocaml-5-volatile-field
Fix a warning when compiling the C stubs with OCaml 5
2 parents c97b887 + 0c82e3c commit 70e6622

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
* Remove unused dependency in dune file. (#969, Kate Deplaix)
1414

15+
* Fix some compilation warnings for C stubs with OCaml 5. (#976, Antonin Décimo)
16+
1517
===== 5.6.1 =====
1618

1719
====== Fixes ======

src/unix/unix_c/unix_tcsetattr_job.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CAMLprim value lwt_unix_tcsetattr_job(value fd, value when, value termios)
5656
LWT_UNIX_INIT_JOB(job, tcsetattr, 0);
5757
job->fd = Int_val(fd);
5858
job->when = when_flag_table[Int_val(when)];
59-
memcpy(&job->termios, &Field(termios, 0), NFIELDS * sizeof(value));
59+
memcpy(&job->termios, (value *)&Field(termios, 0), NFIELDS * sizeof(value));
6060
return lwt_unix_alloc_job(&job->job);
6161
}
6262
#endif

src/unix/unix_c/unix_termios_conversion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static tcflag_t *choose_field(struct termios *terminal_status, long field)
150150
}
151151
}
152152

153-
void encode_terminal_status(struct termios *terminal_status, value *dst)
153+
void encode_terminal_status(struct termios *terminal_status, volatile value *dst)
154154
{
155155
long *pc;
156156
int i;
@@ -207,7 +207,7 @@ void encode_terminal_status(struct termios *terminal_status, value *dst)
207207
}
208208
}
209209

210-
int decode_terminal_status(struct termios *terminal_status, value *src)
210+
int decode_terminal_status(struct termios *terminal_status, volatile value *src)
211211
{
212212
long *pc;
213213
int i;

src/unix/unix_c/unix_termios_conversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424

2525
#define NFIELDS 38
2626

27-
void encode_terminal_status(struct termios *terminal_status, value *dst);
28-
int decode_terminal_status(struct termios *terminal_status, value *src);
27+
void encode_terminal_status(struct termios *terminal_status, volatile value *dst);
28+
int decode_terminal_status(struct termios *terminal_status, volatile value *src);
2929
#endif

0 commit comments

Comments
 (0)