|
From: Maarten B. <sou...@ds...> - 2026-11-03 16:44:47
|
Hi,
I just looked at the history of lkmain.c and I am horrified by what I
encounter.
Many improvements that I made throughout the years have been reverted
purely to
resemble upstream closer. That they reintroduce incorrect comments and
most
probably bugs was disregarded. If you don't know WTF you're doing,
please don't
touch the files! I am very disappointed!
Simple example [r16919]: Many trivial changes from upstream asxxxx.
link_main() was renamed back to link(). That this is a reserved C
library
function from unistd.h and thus should better not be used was dismissed.
That it now can generate warnings or even errors is a "trivial change"!
Other example [r16384]: Change zflag comments to match upstream asxxxx.
- * int zflag Disable symbol case sensitivity
+ * int zflag Enable symbol case sensitivity
Great, now inspect what the code is doing:
lksym.c:
========
lkpsym(char *id, int f)
{
[ ... ]
h = hash(id, zflag);
sp = symhash[h];
while (sp != NULL) {
if (symeq(id, sp->s_id, zflag))
lksym.c:
========
hash(char *p, int cflag)
{
int h;
h = 0;
while (*p) {
if(cflag) {
/*
* Case Insensitive Hash
*/
h += ccase[*p++ & 0x007F];
} else {
/*
* Case Sensitive Hash
*/
h += *p++;
}
}
lksym.c:
========
symeq(char *p1, char *p2, int cflag)
{
int n;
n = strlen(p1) + 1;
if(cflag) {
/*
* Case Insensitive Compare
*/
do {
if (ccase[*p1++ & 0x007F] != ccase[*p2++ &
0x007F])
return (0);
} while (--n);
} else {
/*
* Case Sensitive Compare
*/
do {
if (*p1++ != *p2++)
return (0);
} while (--n);
}
Surprise, surprise! It is treating the zflag as a DISABLE !
Or what about this [r15691]:
- * or read from a command file. The functions nxtline() and
parse()
+ * or read from a command file. The functiond nxtline() and parse()
Brilliant! Bring back the spelling errors!
This clearly shows that the code was not inspected, but blindly copied!
No wonder that the CDB generation is no longer working.
I can only guess how the rest of asxxxx has deteriorated.
I'm wondering if I should give up caring about SDCC and let the bitrot
come in.
Maarten
|