This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc/collect2.c patch




  In message <199812150018.AAA77500@out1.ibm.net>you write:
  > These patches allow -frepo to work with the DJGPP port. They are 
  > essentially the same as the patches I submitted earlier before the 
  > paperwork cleared, except to adjust for the changes made to 
  > collect2.c in the meantime.
  > 
  > Changelog for gcc/collect2.c
  > Include prototypes for pexecute and pwait.
  > (collect_wait): Use pwait instead of wait.
  > (collect_execute): Just use pexecute. Remove conditionalized 
  > code.
  > (main) [DJGPP]: Set flags so system() behaves more Unix-like.
  > 
  > Changelog for gcc/Makefile.in:
  > (collect2.o): Add pexecute.o to dependancies and to link command.
These are going to need a little work.

You shouldn't need to add pexecute/pwait prototypes & definitions to collect2.c
anymore since we get them via libiberty.h (duplicating this stuff is generally
bad anyway).

Similarly, you shouldn't need to add pexecute.o to the collect2 object list
since we should be picking it up via libiberty.a now.

The changes to collect_execute need to be reworked a little to deal with
changes from the last 3 months.

You should avoid stuff like #ifdef __DJGPP__.

You need to review the GNU coding standards.  Most of the changes to 
collect_execute do not follow GNU coding standards.

Some examples:

  if (redir)
  {
/* Open response file */
    redir_handle = open(redir, O_WRONLY | O_TRUNC | O_CREAT);

/* Duplicate the stdout and stderr file handles so they can be restored later */
    stdout_save = dup(STDOUT_FILENO);
    if (stdout_save == -1)


Which is wrong.  It should instead be:

  if (redir)
    {
      /* Open the response file.  */
      redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);

    /* Duplicate the stdout and stderr file handles so they can be restored
       later.  */
      stdout_save = dup (STDOUT_FILENO);
      if (stdout_save == -1)

[ ... ]

Note the indention and whitespace between the function name and open paren for
the function call.  Note the formatting of comments -- write complete
sentences, end them with a period, two spaces, then a close comment.


Normally this code would be small enough that I would fix these errors and
install the change.  However, due to other changes in this code and my
lack of knowledge about cygwin, msdos and friends, I'd prefer someone more
familiar with this code to clean it up.

Sorry for the slow response...


jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]