Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: type-checking for metafiedness? (was: Re: Cores almost on demand in patcompile())
- X-seq: zsh-workers 39628
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: type-checking for metafiedness? (was: Re: Cores almost on demand in patcompile())
- Date: Thu, 13 Oct 2016 11:22:51 +0100
- Cms-type: 201P
- In-reply-to: <20161011065105.GB16819@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAKc7PVBEjPJMtV59CrN6LmrDaoGqfa_DZqwo3Y9HK=+0od7ycA@mail.gmail.com> <CAKc7PVCAR2yTJGgdBbvTp=mBC0ZrXcVWW0DE_U26TezSTNdd=A@mail.gmail.com> <CAKc7PVB=485r3nRz_pP3A-k-oq2pOp5qYUK7pE1VEApXb0pR1g@mail.gmail.com> <CAKc7PVDof_GEuoSv7pg8c1=spXfDkWopP5VR8dVHg-bxXVES1g@mail.gmail.com> <CAKc7PVCRtBBVONgiExopYYUv7x4-HN_QEYk-05aoqZihiCRgMw@mail.gmail.com> <CAH+w=7a7jc0Q2=M9aG5mttbazxfsHB-Cz=WwJzCvz_SdnbApRw@mail.gmail.com> <CGME20161011065321eucas1p22afaabbe1f17f26a1b3507619ed1d96f@eucas1p2.samsung.com> <20161011065105.GB16819@fujitsu.shahaf.local2>
On Tue, 11 Oct 2016 06:51:05 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Pardon me if this has been discussed before, but why don't we introduce
> the type definitions
> .
> struct metafied_t { char *v; };
> struct unmetafied_t { char *v; };
> .
> and start incrementally replacing uses of "char *" with uses of these
> types? This will gain type checking for metafied v. unmetafied strings,
> as these two types do not implicitly convert into each other (attempts
> to do so generate a compiler warning).
This probably is a good idea, although the intermediate state where this
has been only partly done is likely to be a bit of a mess. Modern
compilers should be able to keep this working efficiently.
Some thought could be given as to whether the unmetafied structure should
contain the length, too. The only uses of unmetafied strings I can
think of that wouldn't need it are at the library / system interface,
which requires unmetafied null-terminated strings.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author