pc@unisoft.UUCP (Paul Campbell) (05/16/85)
<munch>
I am posting this because of a bug in the Megamax C system that is
very misleading. Hopefully other people can avoid the problems I had finding
this. There are really two bugs, one masks the other and causes false error
messages.
Bug #1 goes like this
static int fred();
static int (*fred_ptr)() = fred;
/*
.... name and faces removed to protect the innocent ...
*/
static int fred()
{
}
this compiles without error (as it should) but when you link it it
gives a message '(local) identifier not found fred', or something
to that effect. So far so good ... this gives us a reasonable idea
of the problem, and a fix, but read on ...
Bug #2
make a module similar to the above, put it in a library and
then try to link to it
now you get a the same message but with a misleading routine name
'(local) identifier not found $7', L$7 is the size of the local
stack and is defined in a .equ in the library.
Having compiled up a lot of code that uses just these constructs I
have spent the last couple of weeks trying to figure out where the strange
$n messages were coming from !!
Paul Campbell ..!ucbvax!unisoft!paul
bhyde@inmet.UUCP (05/22/85)
Actually the second bug is more like a feature. Local names are stripped from obj-modules as they are inserted in a library. You might even like that if you don't got lots of space. The symbol $7 wasn't the same as the symbol L$7.
adm@cbneb.UUCP (05/22/85)
> ... > static int fred() > { > } > > this compiles without error (as it should) but when you link it it > gives a message '(local) identifier not found fred', or something > to that effect. So far so good ... this gives us a reasonable idea > of the problem, and a fix, but read on ... Doesn't sound like a but to me! Since function fred() is defined as static, no references to fred() are allowed outside this dot-c file. So it will compile, but when you link with another dot-c, any reference to fred() in the second dot-c should produce unresolved external declaration errors (which is what you're seeing with '...identifier not found' messages). Get rid of the "static" in front of "int fred()" and try it.
baron@runx.OZ (Jason Haines) (04/12/86)
Two questions: 1) Has anybody taken a CODE resource from the mmlink and stripped it into an INIT resource? 2) Has Megamax released a HFS-compatible system for C? Thanks in advance, Jason /* Jason Haines * ElecEng Undergraduate * 73 Davidson Avenue * Concord NSW 2137 * AUSTRALIA * * STD: (02) 73-4444 * ISD: +61 2 73-4444 * ACSnet: baron@runx * CSNET: baron@runx.oz * ARPA: baron%runx.oz@seismo.css.gov * JANET: runx.oz!baron@ukc * UUCP: {enea,hplabs,mcvax,prlb2,seismo,ubc-vision,ukc}!munnari!runx.oz!baron */
tim@ism780c.UUCP (Tim Smith) (04/19/86)
In article <994@runx.OZ> baron@runx.OZ (Jason Haines) writes: > >1) Has anybody taken a CODE resource from the mmlink and stripped it into > an INIT resource? It would probably be better to start with a WDEF or MDEF resource, since these won't try to use the jump table. Remember that the code produced by the compiler expects A4 to be set up so that it can find it's global variables. > >2) Has Megamax released a HFS-compatible system for C? > I just talked to them today ( 4/18/86 ). They are having some problems getting Batch to work with HFS. If one buys an update now, one will get HFS versions of everything else, and a coupon for a free upgrade to use when they get Batch to work. And now for the bug... Has anyone else had problems getting te{to,from}scrap to work? Looking at the code in the library, it looks like this has no chance whatsoever of working. For example, it seems to think the 0xAB0 is a pointer to the length of the TEScrap, whereas it appears to me that the length itself is in the word at 0xAB0. This is what it looks like from TMON, anyway, and when I write my own versions of te{to,from}scrap assuming this is true, they work, whereas the Megamax versions bomb. I asked Megamax about this, and they said that customers have called and complained about this, but when they try it, eveything works! I will send them some sample code that fails when I send for the HFS upgrade. -- Tim Smith sdcrdcf!ism780c!tim || ima!ism780!tim || ihnp4!cithep!tim