From 1b82bb025ec2db0f1a01b0059358c3c4bef3983e Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sat, 12 Oct 2019 22:46:42 -0400 Subject: Applied debian patch for undefined operation warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0016-fix-warning-for-undefined-operation-on-sequence-poin.patch From: Jan Date: Sat, 2 Mar 2019 22:56:30 +0100 Subject: fix: warning for undefined operation on sequence point in chpst.c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit chpst.c:312:33: warning: operation on ‘subgetoptarg’ may be undefined [-Wsequence-point] if (optarg[scan_ulong(++optarg, &ul)]) usage(); see accepted answer on: https://stackoverflow.com/questions/10623114/operation-on-may-be-undefined see also http://c-faq.com/expr/seqpoints.html : "... This rule effectively constrains legal expressions to those in which the accesses demonstrably precede the modification." --- chpst.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chpst.c b/chpst.c index 8de213f..1c3073f 100644 --- a/chpst.c +++ b/chpst.c @@ -309,7 +309,8 @@ int main(int argc, char **argv) { case 'n': switch (*optarg) { case '-': - if (optarg[scan_ulong(++optarg, &ul)]) usage(); + ++optarg; + if (optarg[scan_ulong(optarg, &ul)]) usage(); nicelvl =ul; nicelvl *=-1; break; -- cgit v1.2.3