On Thu, 13 Mar 2025, Jakub Jelinek wrote:
> On Thu, Mar 13, 2025 at 03:44:21PM +0100, Richard Biener wrote:
> > + case OPT_D:
> > + case OPT_U:
> > + if (strncmp (options[i].arg, "_FORTIFY_SOURCE",
> > + strlen ("_FORTIFY_SOURCE")) == 0)
>
> I'd say you want to verify that after that substring there is either
> '\0' or "=".
> Otherwise you'll record -D_FORTIFY_SOURCE_NOT_REALLY=1 which doesn't
> matter at all.
I had that first and thought it wasn't worth the cycles, but I can
surely add that (and thus also separate -U and -D handling).
Richard.
> > + {
> > + switches.safe_push (options[i].orig_option_with_args_text);
> > + len += strlen (options[i].orig_option_with_args_text) + 1;
> > + }
> > + /* Otherwise ignore these. */
> > + continue;
> > case OPT_flto_:
> > {
> > const char *lto_canonical = "-flto";
>
> Otherwise LGTM.
>
> Jakub
>
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)