From f9d644e2433389e1f2b83863f32f53e9b8a7e01b Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 24 Mar 2012 19:13:27 +0000 Subject: [PATCH] be really loud when doing unwise things that WILL break in R41 --- check.t | 18 +++++++++++++++++- var.c | 8 ++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/check.t b/check.t index d42187e..81e5bcd 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.518 2012/03/23 23:25:23 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.519 2012/03/24 19:13:25 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -3416,6 +3416,7 @@ expected-stdout: name: integer-base-err-1 description: Can't have 0 base (causes shell to exit) +category: nodeprecated expected-exit: e != 0 stdin: typeset -i i @@ -3425,6 +3426,19 @@ stdin: expected-stderr-pattern: /^.*:.*0#4.*\n$/ --- +name: integer-base-err-1-deprecated +description: + Can't have 0 base (causes shell to exit) +category: !nodeprecated +expected-exit: e != 0 +stdin: + typeset -i i + i=3 + i=0#4 + echo $i +expected-stderr-pattern: + /^.*octal is deprecated\n.*:.*0#4.*\n$/ +--- name: integer-base-err-2 description: Can't have multiple bases in a 'constant' (causes shell to exit) @@ -3628,6 +3642,8 @@ stdin: echo :$((10)).$((010)).$((0x10)). expected-stdout: :10.8.16. +expected-stderr-pattern: + /octal is deprecated/ --- name: integer-base-check-flat-right description: diff --git a/var.c b/var.c index cf6724e..daaab10 100644 --- a/var.c +++ b/var.c @@ -27,7 +27,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/var.c,v 1.143 2012/03/23 23:25:30 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/var.c,v 1.144 2012/03/24 19:13:27 tg Exp $"); /*- * Variables @@ -503,8 +503,12 @@ getint(struct tbl *vp, mksh_ari_t *nump, bool arith) } else if (vp->flag & ZEROFIL) { while (*s == '0') s++; - } else + } else { + warningf(true, "interpreting %s[%lu]='%s' as octal" + " is deprecated", vp->name, + arrayindex(vp), vp->val.s + vp->type); base = 8; + } have_base = true; } #endif