This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][stage1] Wrap option names in gcc internal messages with %< and %>.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Martin Sebor <msebor at gmail dot com>
- Date: Mon, 11 Mar 2019 10:05:21 +0100
- Subject: Re: [PATCH][stage1] Wrap option names in gcc internal messages with %< and %>.
- References: <e4bc8f8d-3de8-6a06-8e54-4e68d43a35f9@suse.cz> <20190311083015.GY7611@tucnak> <28bc1ffb-67f0-65f1-88b9-4557b55cd4d6@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Mar 11, 2019 at 09:57:36AM +0100, Martin Liška wrote:
> On 3/11/19 9:30 AM, Jakub Jelinek wrote:
> > On Mon, Mar 11, 2019 at 09:13:57AM +0100, Martin Liška wrote:
> >> The patch adds a lot of option name wrapping in string format messages. I added a new contrib
> >> script (contrib/check-internal-format-escaping.py) that is parsing gcc.pot file and reports
> >> errors.
> >>
> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> >> Apart from that I built all cross compilers and compared all warnings so that
> >> I don't introduce a bootstrap error. It's expected that various target-specific
> >> tests will need wrapping in scanned patterns.
> >>
> >> Is it fine for next stage1?
> >
> > Generally looks good to me, but I'm not sure about corner cases like:
> > %<-misr-secure=X%>, shouldn't the X be after %>? X is not what users would
> > type. Or reword these to %<-misr-secure=%s%> argument not in between 0 and
> > 23 or similar.
>
> Well, in order to make it consistent, I would put the closing '%>' after
> the whole option=argument expression.
The problem is that the X is not what people should write literally on the
command line, unlike everything else we put in between the quotes. That is
why I suggest to rework it like other targets do, where they actually print
the argument the user specified (which should be in between quotes) and
don't use any X in the wording.
Jakub