Subject: | |
From: | |
Reply To: | |
Date: | Thu, 19 Oct 1995 21:14:33 GMT |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
The /etc/c89.ccg correction that was noted in the porting article on JAZZ is
not complete. The fix that went into the system is sub optimal, but works.
An attempt was made to collapse blanks so that the info string limit in the
compiler would not be reached as quickly. Unfortunately, the algorithm was
incorrect and all blanks were passed through unchanged. The actual fix for
that problem is listed here:
##################################################################
#
# Process out the quotes problem with the CI.
#
temp = CCArgs;
CCArgs = "";
quoted = 0;
blanks = 0;
for (zz in temp) do
if (zz == "\"")
blanks = 0;
CCArgs |= "\"\"";
if (!quote1)
quote2 = 1 - quote2;
fi
elif (zz == "'")
blanks = 0;
CCArgs |= zz;
if (!quote2)
quote1 = 1 - quote1;
fi
elif (zz == " ")
if (quote1 || quote2)
CCArgs |= zz;
elif (!blanks)
CCArgs |= " ";
blanks = 1;
fi
else
blanks = 0;
CCArgs |= zz;
fi
done
Note that blanks are not collapsed out of quoted strings here. I'm not sure
if there are cases where that's important. On -DFOO=\" BAR \", the
compiler gives an error on BAR not having a '-' in front of it. If blanks
are never significant, this algorithm could be greatly simplified.
Steve
|
|
|