[MLton-user] bogus warning messages about scope annotations

John Reppy jhreppy at mac.com
Thu Sep 25 01:09:32 PDT 2008


Upon deeper digging, I realize that I was getting confused between two  
different
copies of the source tree (I was editing one that had the annotations,  
while compiling
the other).  Sorry for the false alarm.

	- John

On Sep 25, 2008, at 2:16 AM, Wesley W. Terpstra wrote:

> 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.
>




More information about the MLton-user mailing list