Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!pasteur!ames!amdahl!pyramid!prls!philabs!ttidca!clark From: clark@ttidca.TTI.COM (Ralph Clark) Newsgroups: comp.os.minix Subject: lib/malloc.c change request Keywords: cc1.2 variable scope bug Message-ID: <2686@ttidca.TTI.COM> Date: 12 Jun 88 23:01:14 GMT Organization: Citicorp/TTI, Santa Monica Lines: 27 Using the 1.2 compiler, I've encountered what seems to be a variable scope bug; static variable declarations do not override global declarations in other files, and cause the similar name to be multiply defined. I found this in lib/malloc.c, which declares static names top, bottom, (and in 1.3, empty). These names are quite likely to occur as global names in another file. I'd like to request that in MINIX 1.3, these be changed in malloc.c to _bottom, _top, and _empty to get around this problem with the 1.2 compiler. The following program will illustrate the problem, complaining that top is multiple declared in malloc.s : ------------ cut --------------- /* test-top.c - test for multiple declared symbol */ extern char *malloc(); int top; main() { char *x; x = malloc(); top = 2; } ------------- end ------------- -- Ralph Clark (clark@ttidca.TTI.COM) {csun|philabs|psivax|trwrb}!ttidca!clark