zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: [PATCH] [long] typeset doesn't report tied parameters (and related issues)
Date: Thu, 11 Oct 2018 13:46:53 +0100	[thread overview]
Message-ID: <20181011124654eucas1p1aeebad2a8807888953b01164384fec74~cjqWzSqtg1007310073eucas1p1C@eucas1p1.samsung.com> (raw)
In-Reply-To: <90011-1539251122.433925@_kdU.FXyh.KLiu>

On Thu, 2018-10-11 at 11:45 +0200, Oliver Kiddle wrote:
> On 7 Oct, Stephane Chazelas wrote:
> > 
> > +#define PM_NAMEDDIR     (1<<31) /* has a corresponding nameddirtab entry    */
> On a 32-bit system, this now results in integer overflow compiler
> warnings. flags in struct hashnode is declared as being of type int.

Right, missed that, sorry.

We still have scope to use the trick we're already using in a number of
other cases --- overlap parameter-only and function-only flags.
Parameters never have ksh or zsh storage type, and functions are never
special or marked as local.

Bumped the dev version number as this will invalidate wordcode.

pws

diff --git a/Config/version.mk b/Config/version.mk
index 8448544..03f6cbf 100644
--- a/Config/version.mk
+++ b/Config/version.mk
@@ -27,5 +27,5 @@
 # This must also serve as a shell script, so do not add spaces around the
 # `=' signs.
 
-VERSION=5.6.2-dev-0
-VERSION_DATE='September 15, 2018'
+VERSION=5.6.2-dev-1
+VERSION_DATE='October 11, 2018'
diff --git a/Src/zsh.h b/Src/zsh.h
index 8d39a04..8941588 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1867,7 +1867,7 @@ struct tieddata {
 /* The following are the same since they *
  * both represent -U option to typeset   */
 #define PM_UNIQUE	(1<<13)	/* remove duplicates                        */
-#define PM_UNALIASED	(1<<13)	/* do not expand aliases when autoloading   */
+#define PM_UNALIASED	(1<<13)	/* (function) do not expand aliases when autoloading   */
 
 #define PM_HIDE		(1<<14)	/* Special behaviour hidden by local        */
 #define PM_CUR_FPATH    (1<<14) /* (function): can use $fpath with filename */
@@ -1876,31 +1876,30 @@ struct tieddata {
 #define PM_TIED 	(1<<16)	/* array tied to colon-path or v.v.         */
 #define PM_TAGGED_LOCAL (1<<16) /* (function): non-recursive PM_TAGGED      */
 
-#define PM_KSHSTORED	(1<<17) /* function stored in ksh form              */
-#define PM_ZSHSTORED	(1<<18) /* function stored in zsh form              */
-
 /* Remaining flags do not correspond directly to command line arguments */
-#define PM_DONTIMPORT_SUID (1<<19) /* do not import if running setuid */
-#define PM_LOADDIR      (1<<19) /* (function) filename gives load directory */
-#define PM_SINGLE       (1<<20) /* special can only have a single instance  */
-#define PM_ANONYMOUS    (1<<20) /* (function) anonymous function            */
-#define PM_LOCAL	(1<<21) /* this parameter will be made local        */
-#define PM_SPECIAL	(1<<22) /* special builtin parameter                */
-#define PM_RO_BY_DESIGN (1<<23) /* to distinguish from specials that can be
+#define PM_DONTIMPORT_SUID (1<<17) /* do not import if running setuid */
+#define PM_LOADDIR      (1<<17) /* (function) filename gives load directory */
+#define PM_SINGLE       (1<<18) /* special can only have a single instance  */
+#define PM_ANONYMOUS    (1<<18) /* (function) anonymous function            */
+#define PM_LOCAL	(1<<19) /* this parameter will be made local        */
+#define PM_KSHSTORED	(1<<19) /* (function) stored in ksh form              */
+#define PM_SPECIAL	(1<<20) /* special builtin parameter                */
+#define PM_ZSHSTORED	(1<<20) /* (function) stored in zsh form              */
+#define PM_RO_BY_DESIGN (1<<21) /* to distinguish from specials that can be
 				   made read-only by the user               */
 #define PM_READONLY_SPECIAL (PM_SPECIAL|PM_READONLY|PM_RO_BY_DESIGN)
-#define PM_DONTIMPORT	(1<<24)	/* do not import this variable              */
-#define PM_RESTRICTED	(1<<25) /* cannot be changed in restricted mode     */
-#define PM_UNSET	(1<<26)	/* has null value                           */
-#define PM_REMOVABLE	(1<<27)	/* special can be removed from paramtab     */
-#define PM_AUTOLOAD	(1<<28) /* autoloaded from module                   */
-#define PM_NORESTORE	(1<<29)	/* do not restore value of local special    */
-#define PM_AUTOALL	(1<<29) /* autoload all features in module
+#define PM_DONTIMPORT	(1<<22)	/* do not import this variable              */
+#define PM_RESTRICTED	(1<<23) /* cannot be changed in restricted mode     */
+#define PM_UNSET	(1<<24)	/* has null value                           */
+#define PM_REMOVABLE	(1<<25)	/* special can be removed from paramtab     */
+#define PM_AUTOLOAD	(1<<26) /* autoloaded from module                   */
+#define PM_NORESTORE	(1<<27)	/* do not restore value of local special    */
+#define PM_AUTOALL	(1<<27) /* autoload all features in module
 				 * when loading: valid only if PM_AUTOLOAD
 				 * is also present.
 				 */
-#define PM_HASHELEM     (1<<30) /* is a hash-element */
-#define PM_NAMEDDIR     (1<<31) /* has a corresponding nameddirtab entry    */
+#define PM_HASHELEM     (1<<28) /* is a hash-element */
+#define PM_NAMEDDIR     (1<<29) /* has a corresponding nameddirtab entry    */
 
 /* The option string corresponds to the first of the variables above */
 #define TYPESET_OPTSTR "aiEFALRZlurtxUhHTkz"


      reply	other threads:[~2018-10-11 12:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 21:05 [PATCH] typeset -p doesn't report -U (unique) attribute Stephane Chazelas
2018-09-25 16:41 ` Daniel Shahaf
2018-10-07 13:35 ` [PATCH] [long] typeset doesn't report tied parameters (and related issues) Stephane Chazelas
2018-10-08  9:05   ` Peter Stephenson
     [not found]     ` <CACeGjnUhNqca7jLAR0KKSxobzDd+xXdAe4BeUeRpxu2CTp_zkA@mail.gmail.com>
2018-10-08 14:10       ` Peter Stephenson
2018-10-08 14:28         ` Daniel Shahaf
2018-10-08 15:24           ` Peter Stephenson
2018-10-08 15:49             ` Daniel Shahaf
2018-10-08 15:57               ` Bart Schaefer
2018-10-08 16:06                 ` Daniel Shahaf
2018-10-08 16:52                   ` Bart Schaefer
2018-10-08 16:58                     ` Peter Stephenson
2018-10-08 16:02               ` Daniel Shahaf
2018-10-08 16:19                 ` Peter Stephenson
2018-10-08 16:43               ` Peter Stephenson
2018-10-08 16:58                 ` Daniel Shahaf
2018-10-08 17:14                   ` Bart Schaefer
2018-10-08 19:39                     ` Stephane Chazelas
2018-10-09  9:02                   ` Peter Stephenson
     [not found]                   ` <1539075745.1499.2.camel@samsung.com>
2018-10-09  9:44                     ` Peter Stephenson
2018-10-09 16:52                       ` Bart Schaefer
2018-10-09 23:40                         ` Vin Shelton
2018-10-08 15:54             ` Bart Schaefer
2018-10-08 16:40               ` Bart Schaefer
2018-10-09 10:59   ` local read-only variables (Was:[PATCH] [long] typeset doesn't report tied parameters (and related issues)) Stephane Chazelas
2018-10-11  9:45   ` [PATCH] [long] typeset doesn't report tied parameters (and related issues) Oliver Kiddle
2018-10-11 12:46     ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20181011124654eucas1p1aeebad2a8807888953b01164384fec74~cjqWzSqtg1007310073eucas1p1C@eucas1p1.samsung.com' \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).