···2121- #11691, #11706: use __asm__ instead of asm for strict ISO C conformance
2222 (Xavier Leroy, report by Gregg Reynolds , review by Sadiq Jaffer)
23232424+- #11764: add prototypes to old-style C function definitions and declarations
2525+ (Antonin Décimo, review by Xavier Leroy)
2626+2427### Code generation and optimizations:
25282629- #8998, #11321, #11430: change mangling of OCaml long identifiers
+2-2
otherlibs/systhreads/st_stubs.c
···223223224224CAMLprim value caml_thread_cleanup(value unit);
225225226226-static void reset_active()
226226+static void reset_active(void)
227227{
228228 Active_thread = NULL;
229229 /* If no other OCaml thread remains, ask the tick thread to stop
···550550 return 0;
551551}
552552553553-static int create_tick_thread()
553553+static int create_tick_thread(void)
554554{
555555 int err;
556556#ifdef POSIX_SIGNALS
+1-2
otherlibs/unix/bind_win32.c
···1717#include "unixsupport.h"
1818#include "socketaddr.h"
19192020-CAMLprim value caml_unix_bind(socket, address)
2121- value socket, address;
2020+CAMLprim value caml_unix_bind(value socket, value address)
2221{
2322 int ret;
2423 union sock_addr_union addr;
+1-2
otherlibs/unix/connect_win32.c
···1818#include "unixsupport.h"
1919#include "socketaddr.h"
20202121-CAMLprim value caml_unix_connect(socket, address)
2222- value socket, address;
2121+CAMLprim value caml_unix_connect(value socket, value address)
2322{
2423 SOCKET s = Socket_val(socket);
2524 union sock_addr_union addr;
+1-1
otherlibs/unix/fork.c
···2828}
29293030/* Post-fork tasks to be carried out in the child */
3131-void caml_atfork_child() {
3131+void caml_atfork_child(void) {
3232 caml_runtime_events_post_fork();
3333 CAML_EV_LIFECYCLE(EV_FORK_CHILD, 0);
3434}
+1-2
otherlibs/unix/listen_win32.c
···1616#include <caml/mlvalues.h>
1717#include "unixsupport.h"
18181919-CAMLprim value caml_unix_listen(sock, backlog)
2020- value sock, backlog;
1919+CAMLprim value caml_unix_listen(value sock, value backlog)
2120{
2221 if (listen(Socket_val(sock), Int_val(backlog)) == -1) {
2322 caml_win32_maperr(WSAGetLastError());
+2-4
otherlibs/unix/nonblock.c
···1717#include <caml/signals.h>
1818#include "unixsupport.h"
19192020-CAMLprim value caml_unix_set_nonblock(socket)
2121- value socket;
2020+CAMLprim value caml_unix_set_nonblock(value socket)
2221{
2322 u_long non_block = 1;
2423···3029 return Val_unit;
3130}
32313333-CAMLprim value caml_unix_clear_nonblock(socket)
3434- value socket;
3232+CAMLprim value caml_unix_clear_nonblock(value socket)
3533{
3634 u_long non_block = 0;
3735
+1-2
otherlibs/unix/shutdown_win32.c
···2020 0, 1, 2
2121};
22222323-CAMLprim value caml_unix_shutdown(sock, cmd)
2424- value sock, cmd;
2323+CAMLprim value caml_unix_shutdown(value sock, value cmd)
2524{
2625 if (shutdown(Socket_val(sock),
2726 shutdown_command_table[Int_val(cmd)]) == -1) {
+1-2
otherlibs/unix/sleep_win32.c
···1717#include <caml/signals.h>
1818#include "unixsupport.h"
19192020-CAMLprim value caml_unix_sleep(t)
2121- value t;
2020+CAMLprim value caml_unix_sleep(value t)
2221{
2322 double d = Double_val(t);
2423 caml_enter_blocking_section();
+2-4
otherlibs/unix/startup.c
···22222323value caml_win32_process_id;
24242525-CAMLprim value caml_unix_startup(unit)
2626- value unit;
2525+CAMLprim value caml_unix_startup(value unit)
2726{
2827 WSADATA wsaData;
2928 int i;
···4039 return Val_unit;
4140}
42414343-CAMLprim value caml_unix_cleanup(unit)
4444- value unit;
4242+CAMLprim value caml_unix_cleanup(value unit)
4543{
4644 caml_win32_worker_cleanup();
4745
+1-1
otherlibs/unix/symlink_win32.c
···36363737// Developer Mode allows the creation of symlinks without elevation - see
3838// https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw
3939-static BOOL IsDeveloperModeEnabled()
3939+static BOOL IsDeveloperModeEnabled(void)
4040{
4141 HKEY hKey;
4242 LSTATUS status;
+1-2
otherlibs/unix/system.c
···2424#include <process.h>
2525#include <stdio.h>
26262727-CAMLprim value caml_unix_system(cmd)
2828- value cmd;
2727+CAMLprim value caml_unix_system(value cmd)
2928{
3029 int ret;
3130 value st;
···145145/* Starts runtime_events. Needs to be called before
146146 [caml_runtime_events_create_cursor]. Needs the runtime lock held to call and
147147 will trigger a stop-the-world pause. Returns Val_unit. */
148148-CAMLextern value caml_runtime_events_start();
148148+CAMLextern value caml_runtime_events_start(void);
149149150150/* Pauses runtime_events if not currently paused otherwise does nothing.
151151 No new events (other than the pause itself) will be written to the ring
152152 buffer by this domain immediately and all other domains soon. Needs the
153153 runtime lock held to call as a pause event is written during this call.
154154 Returns Val_unit. */
155155-CAMLextern value caml_runtime_events_pause();
155155+CAMLextern value caml_runtime_events_pause(void);
156156157157/* Resumes runtime_events if currently paused otherwise does nothing. New events
158158 (as well as a resume event) will be written to this domain immediately and
159159 all other domains soon. Needs the runtime lock held to call as a resume event
160160 is written during this call. Returns Val_unit. */
161161-CAMLextern value caml_runtime_events_resume();
161161+CAMLextern value caml_runtime_events_resume(void);
162162163163#ifdef CAML_INTERNALS
164164···208208209209/* Set up runtime_events (and check if we need to start it immediately).
210210 Called from startup* */
211211-void caml_runtime_events_init();
211211+void caml_runtime_events_init(void);
212212213213/* Destroy all allocated runtime_events structures and clear up the ring.
214214 Called from [caml_sys_exit] */
215215-void caml_runtime_events_destroy();
215215+void caml_runtime_events_destroy(void);
216216217217/* Handle safely re-initialising the runtime_events structures
218218 in a forked child */
219219-void caml_runtime_events_post_fork();
219219+void caml_runtime_events_post_fork(void);
220220221221/* Returns the location of the runtime_events for the current process if started
222222 or NULL otherwise */
223223-CAMLextern char_os* caml_runtime_events_current_location();
223223+CAMLextern char_os* caml_runtime_events_current_location(void);
224224225225/* Functions for putting runtime data on to the runtime_events */
226226void caml_ev_begin(ev_runtime_phase phase);
···234234 function. Until then the buckets are just updated until flushed.
235235*/
236236void caml_ev_alloc(uint64_t sz);
237237-void caml_ev_alloc_flush();
237237+void caml_ev_alloc_flush(void);
238238239239#endif /* CAML_INTERNALS */
240240
···194194/* We use a pre-allocated exception because we can't
195195 do a GC before the exception is raised (lack of stack descriptors
196196 for the ccall to [caml_array_bound_error]). */
197197-static value array_bound_exn()
197197+static value array_bound_exn(void)
198198{
199199 static atomic_uintnat exn_cache = ATOMIC_UINTNAT_INIT(0);
200200 const value* exn = (const value*)atomic_load_acq(&exn_cache);
···114114 int event_id, int event_length, uint64_t *content,
115115 int word_offset);
116116117117-static void runtime_events_create_raw();
117117+static void runtime_events_create_raw(void);
118118119119-void caml_runtime_events_init() {
119119+void caml_runtime_events_init(void) {
120120 runtime_events_path = caml_secure_getenv(T("OCAML_RUNTIME_EVENTS_DIR"));
121121122122 if (runtime_events_path) {
···178178}
179179180180181181-void caml_runtime_events_post_fork() {
181181+void caml_runtime_events_post_fork(void) {
182182 /* We are here in the child process after a call to fork (which can only
183183 happen when there is a single domain) and no mutator code that can spawn a
184184 new domain can have run yet. Let's be double sure. */
···199199200200/* Return the current location for the ring buffers of this process. This is
201201 used in the consumer to read the ring buffers of the current process */
202202-char_os* caml_runtime_events_current_location() {
202202+char_os* caml_runtime_events_current_location(void) {
203203 if( atomic_load_acq(&runtime_events_enabled) ) {
204204 return current_ring_loc;
205205 } else {
···209209210210/* Write a lifecycle event and then trigger a stop the world to tear down the
211211 ring buffers */
212212-void caml_runtime_events_destroy() {
212212+void caml_runtime_events_destroy(void) {
213213 if (atomic_load_acq(&runtime_events_enabled)) {
214214 write_to_ring(EV_RUNTIME, EV_LIFECYCLE, EV_RING_STOP, 0, NULL, 0);
215215···227227/* Create the initial runtime_events ring buffers. This must be called from
228228 within a stop-the-world section if we cannot be sure there is only a single
229229 domain running. */
230230-static void runtime_events_create_raw() {
230230+static void runtime_events_create_raw(void) {
231231 /* Don't initialise runtime_events twice */
232232 if (!atomic_load_acq(&runtime_events_enabled)) {
233233 int ret, ring_headers_length;
···376376 caml_global_barrier();
377377}
378378379379-CAMLprim value caml_runtime_events_start() {
379379+CAMLprim value caml_runtime_events_start(void) {
380380 while (!atomic_load_acq(&runtime_events_enabled)) {
381381 caml_try_run_on_all_domains(&stw_create_runtime_events, NULL, NULL);
382382 }
···384384 return Val_unit;
385385}
386386387387-CAMLprim value caml_runtime_events_pause() {
387387+CAMLprim value caml_runtime_events_pause(void) {
388388 if (!atomic_load_acq(&runtime_events_enabled)) return Val_unit;
389389390390 uintnat not_paused = 0;
···396396 return Val_unit;
397397}
398398399399-CAMLprim value caml_runtime_events_resume() {
399399+CAMLprim value caml_runtime_events_resume(void) {
400400 if (!atomic_load_acq(&runtime_events_enabled)) return Val_unit;
401401402402 uintnat paused = 1;
···515515516516/* Functions for putting runtime data on to the runtime_events */
517517518518-static inline int ring_is_active() {
518518+static inline int ring_is_active(void) {
519519 return
520520 atomic_load_explicit(&runtime_events_enabled, memory_order_relaxed)
521521 && !atomic_load_explicit(&runtime_events_paused, memory_order_relaxed);
···565565 }
566566}
567567568568-void caml_ev_alloc_flush() {
568568+void caml_ev_alloc_flush(void) {
569569 int i;
570570571571 if ( !ring_is_active() )
+2-2
testsuite/tests/asmgen/main.c
···20202121/* This stub isn't needed for msvc32, since it's already in asmgen_i386nt.asm */
2222#if !defined(_MSC_VER) || !defined(_M_IX86)
2323-void caml_call_gc()
2323+void caml_call_gc(void)
2424{
25252626}
2727-void caml_call_realloc_stack()
2727+void caml_call_realloc_stack(void)
2828{
29293030};