Mercury Bugs - mercury
View Issue Details
0000519mercuryBugpublic2020-09-17 05:142020-10-01 23:08
Assigned Tojuliensf 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000519: extras/graphics/mercury_tcltk library may contain reference to unknown matherr symbol
Descriptionmtcltk.m contains the following:

** The following variable is a special hack that is needed in order for
** Sun shared libraries to be used for Tcl.

:- pragma foreign_code("C", "
    extern int matherr(void);
    int *tclDummyMathPtr = (int *) matherr;

This workaround is no longer necessary with modern versions of Tcl and the matherr() function has been removed since version 8.4. [1]

While may be built, the resultant library may cause problems. For example, after building extras/graphics/mercury_tcltk:

$ cd extras/graphics/samples/calc
$ mmc --search-lib-files-dir ../../mercury_tcltk --library mercury_tcltk --make calc
Making calc
** Error making 'calc'.
../../mercury_tcltk/ undefined reference to 'matherr'
collect2: error: ld returned 1 exit status

We could either just remove the workaround or perhaps wrap it in some ifdef/endif block.

TagsNo tags attached.
Attached Files

2020-10-01 23:08   
I've deleted it; I'm pretty sure we don't care about versions of Tcl from before 1999 any more.

Issue History
2020-09-17 05:14keriNew Issue
2020-10-01 23:08juliensfAssigned To => juliensf
2020-10-01 23:08juliensfStatusnew => resolved
2020-10-01 23:08juliensfResolutionopen => fixed
2020-10-01 23:08juliensfNote Added: 0001105