This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] PR 78534 Change character length from int to size_t
- From: Andre Vehreschild <vehre at gmx dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Janne Blomqvist <blomqvist dot janne at gmail dot com>, Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Dec 2016 16:29:07 +0100
- Subject: Re: [PATCH] PR 78534 Change character length from int to size_t
- Authentication-results: sourceware.org; auth=none
- References: <1481536386-8520-1-git-send-email-blomqvist.janne@gmail.com> <20161212183933.5cc86248@vepi2> <CAO9iq9Ezp4MhhMzgLCkRsbwANE0a=m2a5TJe-CP=caAVHO56NQ@mail.gmail.com> <CAO9iq9GNtY8fXTUCV5CtxTtMNVx2zLXaFPPJV8pOxqhTA_0fGQ@mail.gmail.com> <20161216163454.3b061cdd@vepi2> <CAO9iq9EDVe=c0KtH1UjZgomPj0OFq-4UAeko+uRmxTrvk+mr8Q@mail.gmail.com> <20161220144216.0891f455@vepi2> <CAO9iq9ErjvjbE1mvR1dw==_oPBjmJgiA7x6WhR68Fcn36Wv5JA@mail.gmail.com> <20161220150019.GH21933@tucnak>
On Tue, 20 Dec 2016 16:00:19 +0100
Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Dec 20, 2016 at 04:55:29PM +0200, Janne Blomqvist wrote:
> > On Tue, Dec 20, 2016 at 3:42 PM, Andre Vehreschild <vehre@gmx.de> wrote:
> > > Hi all,
> > >
> > >> I think you should use build_zero_cst(size_type_node) instead of
> > >> size_zero_node as size_zero_node is of type sizetype which is not the
> > >> same as size_type_node. Otherwise looks good.
> > >
> > > In the software design classes I took this was called a design error: Not
> > > choosing sufficiently different names for different artifacts. It was
> > > considered a beginner's error.
> >
> > Yeah, sizetype vs. size_type_node is confusing, to say the least..
>
> The first one is GCC internal type for representing sizes, the latter is
> the C size_t (usually they have the same precision, they always have the
> same signedness (unsigned)).
> In the past sizetype actually has been a signed type with very special
> behavior.
I am still wondering if it does not make sense to have something like
gfc_size_t_zero_node to prevent us from repeating build_zero_cst
(size_type_node) all the time. I had to use it 16 times, i.e., 16 times the
code for building a zero size type node is generated instead of a reference to
a "constant". And I don't want to know how often size_zero_node is used in the
wrong location.
- Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de