Article View: comp.sources.bugs
Article #2051calls bug + fix
From: Tom Gerardy
Date: Mon, 13 Feb 1989 21:20
Date: Mon, 13 Feb 1989 21:20
51 lines
1719 bytes
1719 bytes
The version of calls we have has a bug for static functions which are used
before being defined, i.e.:
static void initialize();
...
main (argc, argv)
{
initialize(); /* calls dies here */
...
}
...
static void initialize()
{
...
}
Follows a patch to fix this problem.
*** scan.c.orig Mon Feb 13 13:35:58 1989
--- scan.c Mon Feb 13 12:05:23 1989
***************
*** 57,63 ****
ppHT = & pHTRoot[1]; /* first search statics */
while((pHT = *ppHT) && (i = strcmp(pHT->pchname, name)) <= 0) {
! if (0 == i && 0 == strcmp(pchFile, pHT->pchfile))
break; /* found a visible static function */
ppHT = & pHT->pHTnext;
i = 1;
--- 57,65 ----
ppHT = & pHTRoot[1]; /* first search statics */
while((pHT = *ppHT) && (i = strcmp(pHT->pchname, name)) <= 0) {
! if (0 == i
! && (0 == pHT->pchfile || 0 == strcmp(pchFile, pHT->pchfile))
! )
break; /* found a visible static function */
ppHT = & pHT->pHTnext;
i = 1;
---
- Tom Gerardy UUCP: ...!sun!sunpeaks!unicads!tom
UNICAD, Inc. or: ...!ncar!{sunpeaks|boulder}!unicads!tom
1695 38th Street
Boulder, Colo. 80301 (303) 443-6961
--
- Tom Gerardy UUCP: ...!sun!sunpeaks!unicads!tom
UNICAD, Inc. or: ...!ncar!{sunpeaks|boulder}!unicads!tom
1695 38th Street
Boulder, Colo. 80301 (303) 443-6961
Technical Details
Message-ID:
<334@unicads.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!unicads!tomShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!unicads!tom From: tom@unicads.UUCP (Tom Gerardy) Newsgroups: comp.sources.bugs Subject: calls bug + fix Keywords: calls bug fix Message-ID: <334@unicads.UUCP> Date: 13 Feb 89 21:20:11 GMT Lines: 51