Thread View: comp.bugs.sys5
1 messages
1 total messages
Started by Doug Gwyn
Sat, 25 Nov 1989 05:32
bug in "lint" pass 2
Author: Doug Gwyn
Date: Sat, 25 Nov 1989 05:32
Date: Sat, 25 Nov 1989 05:32
38 lines
1707 bytes
1707 bytes
I found out why the SVR2 version of "lint" would, when fed code like foo.c: #include "hdr.h" ... bar.c: #include "hdr.h" ... hdr.h: extern void XxxxxxxxY(); extern void XxxxxxxxZ(); produce a warning like hdr.h (as included in foo.c): (2) warning: `XxxxxxxxY' may be indistinguishable from `XxxxxxxxY' due to internal name truncation instead of the expected hdr.h (as included in foo.c): (2) warning: `XxxxxxxxY' may be indistinguishable from `XxxxxxxxZ' due to internal name truncation The problem was that the function in "lint" source file lerror2.c named gethstr() returned a pointer to an internal static character buffer, so the second time it was called the new string (internally known as name1) would overwrite the previous one (known as name2) and the printf() would format the message using two pointers to the same static buffer, which contained only the second string read. This is easily fixed by giving gethstr() an integer argument which would be 0 or 1 to select between an array of two internal buffers, and invoke it with different arguments for the two strings needed for the printf(). I had to change about 7 lines of code to implement this fix. They should be obvious to anyone who is competent to make changes to system code. I don't know whether later releases of UNIX System V have the same bug.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads