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

CAMLprim taking (void) as argument #5946

vicuna opened this issue Mar 12, 2013 · 1 comment


None yet
2 participants
Copy link

commented Mar 12, 2013

Original bug ID: 5946
Reporter: bvaugon
Assigned to: @damiendoligez
Status: resolved (set by @damiendoligez on 2014-07-30T12:00:36Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 4.00.1
Target version: 4.02.0+dev
Category: otherlibs
Tags: patch
Monitored by: @gasche

Bug description

Some C primitives of the OCaml otherlibs runtime are declared with "void" as parameters, and take the OCaml value () when they are called. It is not C-valid but works in practice with most C compilers.

I wrote a patch to fix it.

Steps to reproduce

To search these invalid functions, run:

$ grep -RIni CAMLprim otherlibs | grep '(void)'
otherlibs/labltk/support/cltkEvent.c:25:CAMLprim value camltk_tk_mainloop(void)
otherlibs/win32graph/draw.c:62:CAMLprim value caml_gr_current_x(void)
otherlibs/win32graph/draw.c:67:CAMLprim value caml_gr_current_y(void)
otherlibs/win32graph/draw.c:316:CAMLprim value caml_gr_get_mousex(void)
otherlibs/win32graph/draw.c:324:CAMLprim value caml_gr_get_mousey(void)
otherlibs/win32graph/open.c:42:CAMLprim value caml_gr_clear_graph(void);
otherlibs/win32graph/open.c:271:CAMLprim value caml_gr_close_graph(void)
otherlibs/win32graph/open.c:280:CAMLprim value caml_gr_clear_graph(void)
otherlibs/win32graph/open.c:294:CAMLprim value caml_gr_size_x(void)
otherlibs/win32graph/open.c:300:CAMLprim value caml_gr_size_y(void)
otherlibs/win32graph/open.c:315:CAMLprim value caml_gr_synchronize(void)
otherlibs/win32graph/open.c:340:CAMLprim value caml_gr_sigio_handler(void)

File attachments


This comment has been minimized.

Copy link

commented Jul 30, 2014

Comment author: @damiendoligez

for win32graph: patch applied in 4.02 (commit 15033)

for labltk: report transferred to ocamlcore (issue 1412: )

@vicuna vicuna closed this Jul 30, 2014

@vicuna vicuna added this to the 4.02.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.