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] Fix output race in --help -v


On Sun, Mar 1, 2009 at 8:19 AM, Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
> On my system, in the output of 'gcc --help -v', the Ada part begins
> before the driver part ends. ?The effect depends on stdio buffering etc.
>
> The patch below fixes that, and adds a newline between the parts,
> to match the formatting between the other subprocesses' output.
>
> Before:
>
> | Usage: gcc [options] file...
> | Options:
> | ? -pass-exit-codes ? ? ? ? Exit with highest error code from a phase
> [...]
>
> | ? -o <file> ? ? ? ? ? ? ? ?Place the output into <file>
> | ? -x <language> ? ? ? ? ? ?Specify the language of the following input files
> | ? ? ? ? ? ? ? ? ? ? ? ? ? ?Permissible languages include: c c++ assembler none
> | ? ? ? ?The following options are specific to just the language Ada:
> | ? -fRTS= ? ? ? ? ? ? ? ? ? ? ?This switch lacks documentation
> [... options for languages, as, ld, etc. ]
>
> | ? -z KEYWORD ? ? ? ? ? ?Ignored for Solaris compatibility
> |
> | Report bugs to <http://www.sourceware.org/bugzilla/>
> | ? ? ? ? ? ? ? ? ? ? 'none' means revert to the default behavior of
> | ? ? ? ? ? ? ? ? ? ? ? ? ? ?guessing the language based on the file's extension
> |
> | Options starting with -g, -f, -m, -O, -W, or --param are automatically
> | ?passed on to the various sub-processes invoked by gcc. ?In order to pass
> | ?other options on to these processes the -W<letter> options must be used.
> |
> | For bug reporting instructions, please see:
> | <http://gcc.gnu.org/bugs.html>
>
> After:
>
> | Usage: xgcc [options] file...
> | Options:
> | ? -pass-exit-codes ? ? ? ? Exit with highest error code from a phase
> [...]
>
> | ? -o <file> ? ? ? ? ? ? ? ?Place the output into <file>
> | ? -x <language> ? ? ? ? ? ?Specify the language of the following input files
> | ? ? ? ? ? ? ? ? ? ? ? ? ? ?Permissible languages include: c c++ assembler none
> | ? ? ? ? ? ? ? ? ? ? ? ? ? ?'none' means revert to the default behavior of
> | ? ? ? ? ? ? ? ? ? ? ? ? ? ?guessing the language based on the file's extension
> |
> | Options starting with -g, -f, -m, -O, -W, or --param are automatically
> | ?passed on to the various sub-processes invoked by xgcc. ?In order to pass
> | ?other options on to these processes the -W<letter> options must be used.
> |
> | The following options are specific to just the language Ada:
> | ? -fRTS= ? ? ? ? ? ? ? ? ? ? ?This switch lacks documentation
> [... options for languages, as, ld, etc. ]
>
> | ? -z KEYWORD ? ? ? ? ? ?Ignored for Solaris compatibility
> |
> | Report bugs to <http://www.sourceware.org/bugzilla/>
> |
> | For bug reporting instructions, please see:
> | <http://gcc.gnu.org/bugs.html>
>
> AFAICS this is a regression over 4.2, since the new style verbose help
> output was only added since then. ?OK for 4.4?

Ok.

Thanks,
Richard.

> Thanks,
> Ralf
>
> gcc/ChangeLog:
> 2009-03-01 ?Ralf Wildenhues ?<Ralf.Wildenhues@gmx.de>
>
> ? ? ? ?* gcc.c (main): If print_help_list and verbose_flag, ensure
> ? ? ? ?driver output comes before subprocess output.
>
> diff --git a/gcc/gcc.c b/gcc/gcc.c
> index b8691f9..c2850bf 100644
> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -6601,7 +6601,10 @@ main (int argc, char **argv)
>
> ? ? ? /* We do not exit here. ?Instead we have created a fake input file
> ? ? ? ? called 'help-dummy' which needs to be compiled, and we pass this
> - ? ? ? ?on the various sub-processes, along with the --help switch. ?*/
> + ? ? ? ?on the various sub-processes, along with the --help switch.
> + ? ? ? ?Ensure their output appears after ours. ?*/
> + ? ? ?fputc ('\n', stdout);
> + ? ? ?fflush (stdout);
> ? ? }
>
> ? if (verbose_flag)
>
>


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