From: John R. <jh...@ma...> - 2008-09-24 23:07:08
|
On Sep 25, 2008, at 2:16 AM, Wesley W. Terpstra wrote: > On Wed, Sep 24, 2008 at 10:38 PM, John Reppy <jh...@ma...> 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'll see if I can reduce it to a small test case (the actual code is part of the SML3d library, which is a pretty big download). > > > 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? Nope. No error message about "bogus", just the warning about linkage. > > > I did not get this warning on the r6841 version on my windows box at > work. > > This check did not exist in r6841. > |