[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/3] yacc: compute the best type for the state number
From: |
Akim Demaille |
Subject: |
Re: [PATCH 0/3] yacc: compute the best type for the state number |
Date: |
Thu, 3 Oct 2019 08:28:40 +0200 |
Hi Paul,
> Le 3 oct. 2019 à 02:15, Paul Eggert <address@hidden> a écrit :
>
> On 10/1/19 10:27 PM, Akim Demaille wrote:
>> Let's start from this to finish the changes wrt state types
>
> I went through the skeletons and got rid of unsigned types as best I could,
> and installed the attached patch.
This is massive! Thanks!
But I see you already pushed it, although there are things I would have liked
to discuss first. Also, we now have failures in the history of master and
maint, which I strive to avoid. And the CI is red currently.
Please, in the future, make smaller commits, per topic. And run the test suite
with an old compiler too.
> This also removes some casts that I think are no longer needed. (It also adds
> casts in some places, alas.)
Yep, I saw this. This is cast within C itself :)
> Not being a C++ expert, I may have messed up the C++ skeletons but I figure
> we can fix them as needed.
I'll do that, but I first have to re-rebase my changes from yesterday, which
were waiting the green light from the CI.
About your changes. I don't want to break the API for the generated locations
in C++. At least we need to talk about this with users. Also, I dislike the
fact that the examples in the documentation become more complex for being more
robust. I fully agree that examples should not be too naive, but IMHO going
from
> if (i == length)
> {
> length *= 2;
> symbuf = realloc (symbuf, length + 1);
> }
to
> if (bufsize <= i)
> {
> ptrdiff_t maxsize
> = (PTRDIFF_MAX < SIZE_MAX
> ? PTRDIFF_MAX : SIZE_MAX);
> if ((maxsize - 40) / 2 < bufsize)
> abort ();
> bufsize = 2 * bufsize + 40;
> symbuf = realloc (symbuf, bufsize);
> if (!symbuf)
> abort ();
> }
clutters the documentation.
Old compilers choke on the current code in master, we have to stop and focus on
this first.
Cheers!
- Re: [PATCH 0/3] yacc: compute the best type for the state number, (continued)
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/02
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Kaz Kylheku, 2019/10/02
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Paul Eggert, 2019/10/02
- Re: [PATCH 0/3] yacc: compute the best type for the state number,
Akim Demaille <=
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Paul Eggert, 2019/10/03
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/03
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/04
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/05
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Paul Eggert, 2019/10/05
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/05
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/06
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Paul Eggert, 2019/10/06
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Paul Eggert, 2019/10/05
- Re: [PATCH 0/3] yacc: compute the best type for the state number, Akim Demaille, 2019/10/05