Обсуждение: Small const correctness patch
Hello all,
Please find attached a trivial patch making a few arrays const (in addition to the data they point to).
Вложения
+1
Patch successfully applied to the master (43211c2a02f39d6568496168413dc00e0399dc2e)
On Thu, Aug 8, 2019 at 12:30 PM Mark G <markg735@gmail.com> wrote:
Hello all,Please find attached a trivial patch making a few arrays const (in addition to the data they point to).
Ibrar Ahmed
On 2019-08-08 08:46, Mark G wrote: > Please find attached a trivial patch making a few arrays const (in > addition to the data they point to). How did you find this? Any special compiler settings? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On Thu, Aug 8, 2019 at 8:51 PM Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
How did you find this? Any special compiler settings?
16 hours stuck in a plane on an international flight. I was just eyeballing the code to kill the boredom.
-Mark
On Thu, Aug 8, 2019 at 8:25 PM Ibrar Ahmed <ibrar.ahmad@gmail.com> wrote:
+1Patch successfully applied to the master (43211c2a02f39d6568496168413dc00e0399dc2e)
That change looks like an unrelated patch for initdb. I'm still not seeing my patch there.
-Mark
On Fri, Aug 9, 2019 at 1:25 AM Mark G <markg735@gmail.com> wrote:
On Thu, Aug 8, 2019 at 8:25 PM Ibrar Ahmed <ibrar.ahmad@gmail.com> wrote:+1Patch successfully applied to the master (43211c2a02f39d6568496168413dc00e0399dc2e)That change looks like an unrelated patch for initdb. I'm still not seeing my patch there.
I said I checked and verified patch against that hash. It applied to that without any failure. Sorry for the confusion.
-Mark
Ibrar Ahmed
At Thu, 8 Aug 2019 22:56:02 +0300, Mark G <markg735@gmail.com> wrote in
<CAEeOP_Y3SAXe8u++9e-CN_+MgY9_u+vu3a80sw+7gzR4s7KjqQ@mail.gmail.com>
> On Thu, Aug 8, 2019 at 8:51 PM Peter Eisentraut <
> peter.eisentraut@2ndquadrant.com> wrote:
>
>
> > How did you find this? Any special compiler settings?
> >
>
> 16 hours stuck in a plane on an international flight. I was just eyeballing
> the code to kill the boredom.
A similar loose typing is seen, for example:p
-const char *
+const char * const
src/backend/access/rmgrdesc/*.c
relmap_identify(uint8 info)
seq_identify(uint8 info)
smgr_identify(uint8 info)
.... (many)...
src/backend/access/transam/xact.c:
BlockStateAsString(TBlockState blockState)
I foundnd them by
find $(TOP) -type f -exec egrep -nH -e '^(static )?const char \*' {} +
then eyeballing on the first ones. I don't know an automated way
to detect such possibly-loose constness of variables or
functions.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
On 2019-08-08 08:46, Mark G wrote: > Please find attached a trivial patch making a few arrays const (in > addition to the data they point to). committed -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services