Skip to content

[bug] Over-lax arithmetic: '**=' assignment operator accepted (GNU 5.3: arithmetic syntax error) #342

Closed

Description

@caomengxuan666

Found by gnusweep3 lane (cat4 a039; WSL GNU Bash 5.3.0 oracle, worktree 0fe8d0f).

Repro:

a=2
echo $((a **= 5))

GNU 5.3.0: line 2: a **= 5: arithmetic syntax error: operand expected (error token is "= 5"), rc=1, no output.
rubash: prints 32, rc=0.

GNU C owner: expr.c:44 assignment-operator table — "=", "*=", "/=", "%=", "+=", "-=", "<<=", ">>=", "&=", "^=", "|=" — no **= entry; exponentiation ipow() (expr.c:948) is a binary op only, and ** followed by = is a syntax error.
Artifacts: target/issue-suites/results/gnusweep3/cat4/case/a039.; minimal target/issue-suites/results/gnusweep3/probes/min/m08-powassign.

Activity

  1. added
    bug
    gnu-baseline
    on Sep 30, 2026
  2. added 2 commits that reference this issue on Sep 30, 2026
  3. caomengxuan666 commented on Sep 30, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by wt20/deepsweep (4bcd2b62): **= removed from the operator tables -> GNU-exact operand expected (error token is "= 5") (expr.c:44).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions