java/1470: dependency code puts the wrong file first

Tom Tromey tromey@cygnus.com
Wed Dec 20 12:29:00 GMT 2000


>Number:         1470
>Category:       java
>Synopsis:       dependency code puts the wrong file first
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    green
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:20:24 PST 2000
>Closed-Date:    Sat Feb 19 15:05:11 PST 2000
>Last-Modified:  Sat Feb 19 15:16:00 PST 2000
>Originator:     Tom Tromey
>Release:        current cvs
>Organization:
>Environment:

>Description:
Current if I compile a file called C.java with -M, I can
get a dependency list that looks like this:

creche. gcj -M C.java 
C.o : ./A.java ./B.java /x1/egcs/install/share/libgcj.zip C.java

It is customary for C.java to appear first on this list.
(This is a fairly minor problem.)
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR gcj/89

Responsible-Changed-From-To: apbianco->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Thu Nov  4 21:44:10 1999
Responsible-Changed-Why:
    This is mine.

From: tromey@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: gcj/89
Date: 5 Nov 1999 05:44:10 -0000

 Synopsis: dependency code puts the wrong file first
 
 Responsible-Changed-From-To: apbianco->tromey
 Responsible-Changed-By: tromey
 Responsible-Changed-When: Thu Nov  4 21:44:10 1999
 Responsible-Changed-Why:
     This is mine.
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=java&pr=89

From: Anthony Green <green@cygnus.com>
To: gcc-patches@gcc.gnu.org
Cc: java-gnats@sourceware.cygnus.com
Subject: gcj/89 patch: emit dependencies in preferred order
Date: Sun, 13 Feb 2000 11:46:44 -0800

 This patch fixes PR gcj/89.  It changes `gcj -M' to emit dependencies
 in the preferred order.
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=java&pr=89
 
 
 2000-02-13  Anthony Green  <green@cygnus.com>
 
         * jcf-depend.c (add_entry): Add entries to the end of the list.
 
 Index: gcc/java/jcf-depend.c
 ===================================================================
 RCS file: /cvs/gcc/egcs/gcc/java/jcf-depend.c,v
 retrieving revision 1.7
 diff -u -r1.7 jcf-depend.c
 --- jcf-depend.c	2000/01/21 20:57:00	1.7
 +++ jcf-depend.c	2000/02/13 19:40:11
 @@ -78,22 +78,30 @@
    *entp = NULL;
  }
  
 -/* Helper to add to entry list.  */
 +/* Helper to add to the end of the entry list.  */
  static void
  add_entry (entp, name)
       struct entry **entp;
       const char *name;
  {
 -  struct entry *ent;
 +  struct entry *ent, *last;
  
 -  for (ent = *entp; ent != NULL; ent = ent->next)
 +  for (last = ent = *entp; ent != NULL; last = ent, ent = ent->next)
      if (! strcmp (ent->file, name))
        return;
  
    ent = (struct entry *) xmalloc (sizeof (struct entry));
    ent->file = xstrdup (name);
 -  ent->next = *entp;
 -  *entp = ent;
 +  ent->next = NULL;
 +
 +  if (last == NULL)
 +    {
 +      // This is only true the first time through, when the entry list
 +      // is empty.
 +      *entp = ent;
 +    }     
 +  else
 +    last->next = ent;
  }
  
  /* Call this to reset the dependency module.  This is required if
 
 -- 
 Anthony Green                                                        Red Hat
                                                        Sunnyvale, California
Responsible-Changed-From-To: tromey->green
Responsible-Changed-By: green
Responsible-Changed-When: Sun Feb 13 11:52:05 2000
Responsible-Changed-Why:
    I've fixed this.
State-Changed-From-To: open->feedback
State-Changed-By: green
State-Changed-When: Sun Feb 13 11:52:05 2000
State-Changed-Why:
    I've submitted a gcc patch for this.
    http://gcc.gnu.org/ml/gcc-patches/2000-02/msg00378.ht

From: green@cygnus.com
To: green@cygnus.com, java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: gcj/89
Date: 13 Feb 2000 19:52:05 -0000

 Synopsis: dependency code puts the wrong file first
 
 Responsible-Changed-From-To: tromey->green
 Responsible-Changed-By: green
 Responsible-Changed-When: Sun Feb 13 11:52:05 2000
 Responsible-Changed-Why:
     I've fixed this.
 State-Changed-From-To: open->feedback
 State-Changed-By: green
 State-Changed-When: Sun Feb 13 11:52:05 2000
 State-Changed-Why:
     I've submitted a gcc patch for this.
     http://gcc.gnu.org/ml/gcc-patches/2000-02/msg00378.ht
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=89&database=java
State-Changed-From-To: feedback->closed
State-Changed-By: green
State-Changed-When: Sat Feb 19 15:05:11 2000
State-Changed-Why:
    tromey and apbianco said the patch was OK - so I've checked it in.

From: green@cygnus.com
To: green@cygnus.com, java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: gcj/89
Date: 19 Feb 2000 23:05:11 -0000

 Synopsis: dependency code puts the wrong file first
 
 State-Changed-From-To: feedback->closed
 State-Changed-By: green
 State-Changed-When: Sat Feb 19 15:05:11 2000
 State-Changed-Why:
     tromey and apbianco said the patch was OK - so I've checked it in.
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=89&database=java
>Unformatted:




More information about the Gcc-prs mailing list