This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Preventing ISO C errors when using macros for builtin types
- From: Jozef Lawrynowicz <jozefl dot gcc at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, David Malcolm <dmalcolm at redhat dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 12 Jun 2019 17:40:27 +0100
- Subject: Re: Preventing ISO C errors when using macros for builtin types
- References: <20190605142559.05791323@jozef-kubuntu> <CAFiYyc3cVsk1phrC0gTJa=mJOjzCJ-Be2GTaaYoJemCNBRYb0w@mail.gmail.com> <20190610172031.66eabae6@jozef-kubuntu> <20190610183242.GG31586@gate.crashing.org> <20190610205800.0cf0cdef@jozef-kubuntu> <20190610220910.GH31586@gate.crashing.org> <20190611214430.75e88154@jozef-kubuntu> <20190611230155.GM31586@gate.crashing.org>
On Tue, 11 Jun 2019 18:01:55 -0500
Segher Boessenkool <segher@kernel.crashing.org> wrote:
> On Tue, Jun 11, 2019 at 09:44:30PM +0100, Jozef Lawrynowicz wrote:
> > --- a/gcc/lto/lto-lang.c
> > +++ b/gcc/lto/lto-lang.c
> > @@ -1260,9 +1260,9 @@ lto_build_c_type_nodes (void)
> > if (int_n_enabled_p[i])
> > {
> > char name[50];
> > - sprintf (name, "__int%d unsigned", int_n_data[i].bitsize);
> > + sprintf (name, "int%d", int_n_data[i].bitsize);
> >
> > - if (strcmp (name, SIZE_TYPE) == 0)
> > + if (strstr (SIZE_TYPE, name) != NULL)
> > {
> > intmax_type_node = int_n_trees[i].signed_type;
> > uintmax_type_node = int_n_trees[i].unsigned_type;
>
> I don't think that is correct, strstr allows too much? If you want to
> allow some variants, you should test for all those variants exactly?
Yeah I'll fix this up in my full patch submission.
> It looks great otherwise :-)
>
>
> Segher
Great, thanks for all your help!
Jozef