This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] New port for CR16C and CRX processors (gcc)
Kazu Hirata <firstname.lastname@example.org> 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 unsigned int header_was_printed = FALSE;
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
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.