HP3000-L Archives

October 1995, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Steve Elmer <[log in to unmask]>
Reply To:
Steve Elmer <[log in to unmask]>
Date:
Thu, 19 Oct 1995 21:14:33 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (48 lines)
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

ATOM RSS1 RSS2