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

Native dynlink and filenames containing '-' #4607

Closed
vicuna opened this Issue Aug 28, 2008 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

commented Aug 28, 2008

Original bug ID: 4607
Reporter: monate
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2008-09-10T15:03:40Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11+dev
Fixed in version: 3.11+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: "Julien Signoles"

Bug description

Hello camlers,

Using the files :
===static.ml===
open Dynlink
let () =
try
init ();
loadfile "dyn.cmxs"
with Error e -> Format.printf "%s@." (error_message e)

==dyn-dyn.ml==
Format.printf "HELLO@.";;

and compiling with

ocamlopt -shared -o dyn-dyn.cmxs dyn-dyn.ml
ocamlopt -o test dynlink.cmxa static.ml

./test does not print anything -> initialization of module dyn-dyn.ml is not performed.
If the filename is a legal ocaml module name everything works as expected.
In bytecode everything works as expected.

This can be reproduced with Ocaml 3.11+dev15 Private_abbrevs+natdynlink+lazy_patterns (2008-07-29)
under both Linux/AMD64 and Win32/Mingw.

Thanks for your help.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 28, 2008

Comment author: @alainfrisch

Do we agree that it is an error if the filename does not give a valid module name? This should probably be checked by the compiler.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 28, 2008

Comment author: monate

Well I would not care if this was an error.
The discrepancy between byte and native code is my only concern. If the compiler enforces this check then it must do it in both modes.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 10, 2008

Comment author: @damiendoligez

Do we agree that it is an error if the filename does not give a valid module name?

Indeed. The 3.11.0 compilers will report an error in that case.
EDIT: For compatibility reasons, this was changed to a warning.

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.