On 2012/02/23 09:01:28, bytbox wrote: > Hello mailto:golang-dev@googlegroups.com (cc: mailto:golang-dev@googlegroups.com), > > I'd like you ...
13 years, 3 months ago
(2012-02-23 10:42:55 UTC)
#2
On 2012/02/23 09:01:28, bytbox wrote:
> Hello mailto:golang-dev@googlegroups.com (cc:
mailto:golang-dev@googlegroups.com),
>
> I'd like you to review this change to
> https://go.googlecode.com/hg/
In my opinion, the patch can be improved in the following way (conceptually):
static Vec gccargs;
static int gccargs_cmdlen;
...
xgetenv(&b, "CC");
gccargs_cmdlen = <the number of fields in CC>;
...
vcopy(&link, gccargs.p, gccargs_cmdlen);
On 2012/02/23 10:42:55, atom wrote: > On 2012/02/23 09:01:28, bytbox wrote: > > Hello mailto:golang-dev@googlegroups.com ...
13 years, 3 months ago
(2012-02-23 10:45:05 UTC)
#3
On 2012/02/23 10:42:55, atom wrote:
> On 2012/02/23 09:01:28, bytbox wrote:
> > Hello mailto:golang-dev@googlegroups.com (cc:
> mailto:golang-dev@googlegroups.com),
> >
> > I'd like you to review this change to
> > https://go.googlecode.com/hg/
>
> In my opinion, the patch can be improved in the following way (conceptually):
>
> static Vec gccargs;
> static int gccargs_cmdlen;
> ...
> xgetenv(&b, "CC");
> gccargs_cmdlen = <the number of fields in CC>;
> ...
> vcopy(&link, gccargs.p, gccargs_cmdlen);
Also, the following line:
if(xstrstr(gccargs.p[0], "clang") != nil) {
should be changed into:
if(xstrstr(gccargs.p[gccargs_cmdlen-1], "clang") != nil) {
bytbox@gmail.com once said: > // C command. > // Use gccargs, but ensure that link.p[2] ...
13 years, 3 months ago
(2012-02-23 11:47:03 UTC)
#4
bytbox@gmail.com once said:
> // C command.
> // Use gccargs, but ensure that link.p[2] is output file,
> // as noted above.
> - vadd(&link, gccargs.p[0]);
> + vcopy(&link, gccargs.p, gccargs.len-1);
> vadd(&link, "-o");
> vadd(&link, bpathf(&b, "%s/%s%s", tooldir, name, exe));
> - vcopy(&link, gccargs.p+1, gccargs.len-1);
> if(streq(gohostarch, "amd64"))
> vadd(&link, "-m64");
> else if(streq(gohostarch, "386"))
Doesn't this change go against the comment directly above it?
Now link.p[2] won't be the output file.
Anthony
Issue 5700044: code review 5700044: dist: treat CC as one unit
(Closed)
Created 13 years, 3 months ago by bytbox
Modified 13 years, 3 months ago
Reviewers: atom
Base URL:
Comments: 3