[MLton-user] bogus warning messages about scope annotations

Wesley W. Terpstra wesley at terpstra.ca
Wed Sep 24 18:16:02 PDT 2008


On Wed, Sep 24, 2008 at 10:38 PM, John Reppy <jhreppy at mac.com> wrote:

> Using a fresh version of mlton on Mac OS X, I'm getting messages of the
> form
>
> Warning: /Users/jhr/Work/ICFPContest08/sml3d/src/glut/glut.sml 413.28.
>  Symbol 'glutCreateMenuCB' redeclared as external (previously public). This
> may cause linker errors.
>
> when the code at lines 412-413 is
>
>    val exportCreateMenu        = _export "glutCreateMenuCB" private cdecl :
> (int -> unit) -> unit;
>    val glutCreateMenuCB        = _address "glutCreateMenuCB" private :
> Ptr.t;


That's strange. I copy and pasted those lines to a file (replacing Ptr with
MLton.Pointer) and saw no warnings. Can you please provide a complete source
file which causes these warnings?


> I've tried various other annotations instead of private, but the message is
> consistent.  In fact, it turns out that one can put any identifier as an
> annoation and
> still get the same message.  E.g.,
>
>    val exportCreateMenu        = _export "glutCreateMenuCB" bogus cdecl :
> (int -> unit) -> unit;
>    val glutCreateMenuCB        = _address "glutCreateMenuCB" bogus : Ptr.t;


The default visibility is public for export and external for address. So
that's not unexpected as bogus is invalid and didn't override the defaults.
I assume you also got errors that 'bogus' was unrecognized in this case?

I did not get this warning on the r6841 version on my windows box at work.
>

This check did not exist in r6841.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20080925/e3a48515/attachment.htm


More information about the MLton-user mailing list