public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: ludovic.courtes@inria.fr (Ludovic Courtès)
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l
Date: Mon, 12 Mar 2012 11:02:00 -0000	[thread overview]
Message-ID: <87y5r6t754.fsf@inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.64.1203091723210.12881@digraph.polyomino.org.uk>	(Joseph S. Myers's message of "Fri, 9 Mar 2012 17:27:49 +0000 (UTC)")

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

Hi,

Thanks for the review.

"Joseph S. Myers" <joseph@codesourcery.com> skribis:

> On Fri, 9 Mar 2012, Ludovic Courtès wrote:
>
>> 	* gcc/opts-common.c (generate_option): Don't insert white space in
>> 	`canonical_option' when OPT_INDEX is OPT_l.
>
> No, opts-common.c should not have special cases for individual options 
> like that.  The canonical form has the separate arguments.

Indeed, and the comment in opts.h makes it clear, though I think I was
confused by the phrase “original text of option”.

> gcc.c has a special case for how it passes this option to
> subprocesses; if you have problems with some output from gfortran
> involving -l options, you should change the gfortran driver as needed
> so it outputs -l options in a different way.

The patch below solves the problem in a gfortran-specific way.  WDYT?

Thanks,
Ludo’.

2012-03-09  Ludovic Courtès  <ludovic.courtes@inria.fr>

	* gcc/fortran/gfotranspec.c (lang_specific_driver): When
	VERBOSE, make sure `-l' options are printed with no intertwined
	white spaces.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 698 bytes --]

diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index 2240bfb..55e5e42 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n"));
     {
       fprintf (stderr, _("Driving:"));
       for (i = 0; i < g77_newargc; i++)
+	{
+	  if (g77_new_decoded_options[i].opt_index == OPT_l)
+	    /* Make sure no white space is inserted after `-l'.  */
+	    fprintf (stderr, " -l%s",
+		     g77_new_decoded_options[i].canonical_option[1]);
+	  else
 	fprintf (stderr, " %s",
 		 g77_new_decoded_options[i].orig_option_with_args_text);
+	}
       fprintf (stderr, "\n");
     }

  reply	other threads:[~2012-03-12 11:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09 15:38 [PATCH] Don’t insert white space in ‘orig_option_with_args_text’ " Ludovic Courtès
2012-03-09 17:28 ` [PATCH] Don't insert white space in 'orig_option_with_args_text' " Joseph S. Myers
2012-03-12 11:02   ` Ludovic Courtès [this message]
2012-03-12 12:41     ` Joseph S. Myers
2012-03-13 10:12       ` Ludovic Courtès
2012-03-29  8:38         ` [PATCH, ping #1] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5r6t754.fsf@inria.fr \
    --to=ludovic.courtes@inria.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).