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]
Other format: [Raw text]

Re: [PATCH] New port for CR16C and CRX processors (gcc)


Kazu Hirata <kazu@cs.umass.edu> writes:

> o I am not sure if you should directly include header files from the C
>   library, which would sort of bypass the configure's benefit.  I am
>   no expert on this, so I let other people comment on this.
>
>   #include <stdio.h>
>   #include <sys/time.h>

Only include C header files if they are not included by system.h.
If those headers are not part of C89 they MUST be properly guarded
with #ifdefs.  <sys/time.h> is in this category.

The thing sys/time.h is being used for is another story ...

/* Implements the macro ASM_FILE_START defined in cr16c.h.  */

/* In gcc-3.4 the function cr16c_asm_file_start does not get the parament file 
   and the output is to asm_out_file */
static
void
cr16c_asm_file_start(void)
{
  static unsigned int header_was_printed = FALSE;
  char *gentime;
  time_t clock1;

  if (header_was_printed)
    return;

  clock1 = time(&clock1);
  gentime = ctime(&clock1);

  fprintf (asm_out_file, "#\t-- %s --\t%s#\n", asm_file_name, gentime);
  output_file_directive (asm_out_file, main_input_filename);
  
  header_was_printed = TRUE;
}

As a matter of policy, we don't want this kind of junk in GCC assembly
output.  Just emit the file directive (which the default
ASM_FILE_START will do for you, IIRC).  Then you don't need sys/time.h
at all.

I note a large number of stylistic deviations from the GNU coding
standards, by the way.  I'm not going to go into these in detail.

zw


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