Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] -unsafe and camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitry Bely <dbely@m...>
Subject: Re: [Caml-list] camlp4
Xavier Leroy <> writes:

>> Can two things live together? When I run ocamlopt -unsafe -pp
>> "camlp4 ..." ..., compiler prints warning and -unsafe seems to be
>> ignored. Am I doing something wrong?
> "-unsafe" is a parsing-time option: it governs how the .[] and .()
> notations are parsed into applications of functions from the Array and
> String modules.  Hence, if you use camlp4 for parsing, you should pass
> the -unsafe option to camlp4, not to ocamlc/ocamlopt.

Ah, I see. thank you very much.

There is another problem with camlp4. When it reports syntax error, it
doesn't count the lines, say:

File "", line 1, characters 12398-12401:

(line is always equal to 1, at least under Windows)

I compile Ocaml sources within XEmacs/Win32/tuareg mode, and Emacs consider
EOL in the buffer as ONE character, while camlp4 counts it as TWO chars. So
the error place is pointed incorrectly.

How do you think, where it could be fixed? (camlp4, tuareg,...)?

- Dmitry Bely

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: