From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 205 invoked by alias); 16 Oct 2016 17:05:09 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39656 Received: (qmail 1368 invoked from network); 16 Oct 2016 17:05:09 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(0.0/5.0):. Processed in 0.129697 secs); 16 Oct 2016 17:05:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=yTsh8uqhM42P/nPS9Ig7phyIbU0=; b=2LJmdP 3flZNLnv0ttkq/MQRs4j5K5WH5It0VMETcVPCujWuWsT+Q2+VtVctEydYiXKZlPk hEnvVnW/raoX5eZRJF6O94kLnY8YYAtjsm1zvOm0tNy36bUQtdySFhSTyVpIJtat SWXws5VidoI3RDmmMvN9VXg3NT7eOL0d+Zqqw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=yTsh8uqhM42P/nPS9Ig7phyIbU0=; b=UfSWR 5abxi6AiRUP3zRxotOMue1i99CeTodyTXbWbfRKiSj9nnKgb+sqmUVbnksL2EUrY VK7BuNomGFXZR7msx3IL31+ou68HYkrgG+TzS1543hVRq81eQGwrsDGpKMsNnu9l +kV8hkCA76tsJbaty3xzOztisDuS13JuCZ+K2E= X-Sasl-enc: bSCCRV1BaHhDq8/kXis7UWSMRpUstvnM/jkNK50fh14b 1476637505 Date: Sun, 16 Oct 2016 17:03:19 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: type-checking for metafiedness? (was: Re: Cores almost on demand in patcompile()) Message-ID: <20161016170319.GA16717@fujitsu.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Sat, Oct 15, 2016 at 18:14:44 -0700: > On Sat, Oct 15, 2016 at 1:30 AM, Daniel Shahaf wrote: > > > > Does anyone have a way to get type checking that doesn't involve > > adding .v everywhere? > > Wouldn't it suffice to use > typedef char *unmeta_t; > typedef unsigned char *meta_t; > Another option: use incomplete struct types: . typedef char *unmeta_t; typedef struct incomplete_meta_t *meta_t; > (or the reverse if we believe we're mostly going to be working on > meta_t). If we do that and also enable the GCC warnings -Wtype-limits > -Wconversion -Wformat-signedness would we not get adequate verbosity > without changing pointer arithmetic and dereferencing? > > I hadn't even considered all the places where using a struct would > change memory allocation strategy. Oof. >