2014-08-30 27 views
4

我只是想我的代碼以OCaml的4.02(使用OPAM),我得到很多的警告是這樣的:mark_tag_used與OCaml的警告4.02.0

File "_tags", line 14, characters 121-134: 
Warning: the tag "link(utils.o)" is not used in any flag 
declaration, so it will have no effect; it may be a typo. 
Otherwise use `mark_tag_used` in your myocamlbuild.ml to 
disable this warning. 

但它是在myocamlbuld.ml定義:

pdep ["link"] "link" (fun param -> [param]); 

我可以擺脫它:

mark_tag_used("link(utils.o)"); 

但我需要一個這樣的行每次使用標籤的!此外,我的代碼將不會與早期版本的OCaml一起構建。什麼是一般修復?

(完整的代碼爲https://github.com/0install/0install

+0

我用4.02.0編譯了一個我的項目,並且通過一些實際使用的標籤獲得相同的警告。我還沒有看過它,但很好奇,如果你已經查明瞭原因。 – nlucaroni 2014-09-25 02:53:53

+0

不,我還沒有。由於緩慢編譯的問題(我將在4.02.1中解決這個問題),我回到4.01.0。 – 2014-09-26 09:53:22

+0

這似乎是一個迄今未報告的ocamlbuild錯誤。你應該隨時報告這些問題[關於bugtracker](http://caml.inria.fr/mantis/)。 – gasche 2015-06-05 14:47:07

回答

0

我擺脫了同樣的警告,當我在我的myocamlbuild.ml

dispatch @@ MyOCamlbuildBase.dispatch_combine [ 
    begin function 
    (* ... *) 
    end; 
    dispatch_default 
] 
;; 

,而不是

dispatch 
begin function (* ... *) 

,並重新運行oasis setup。 YMMV

+0

有趣,但我沒有使用OASIS,只是簡單的'ocamlbuild'。 – 2014-11-30 15:19:32