-
Notifications
You must be signed in to change notification settings - Fork 577
9fdd7fc479 breaks build using g++ as compiler #20108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Compilation on FreeBSD-12 using g++ version 10.3.0 ends here:
|
And, no surprise, clang++ builds are breaking as well. Here's one on OpenBSD. |
Correction for copy/paste error noted by Bram: |
Code in 9fdd7fc broke the g++ builds, Basically what the code looked like: switch (o->op_type) { ... case OP_SASSIGN: ... OP* rhs = cBINOPx(o)->op_first; OP* lval = cBINOPx(o)->op_last; ... break; case OP_AASSIGN: { g++ does not allow this and errors with: peep.c:3897:14: error: jump to case label 3897 | case OP_AASSIGN: { | ^~~~~~~~~~ peep.c:3844:17: note: crosses initialization of 'OP* lval' 3844 | OP* lval = cBINOPx(o)->op_last; | ^~~~ peep.c:3843:17: note: crosses initialization of 'OP* rhs' 3843 | OP* rhs = cBINOPx(o)->op_first; | ^~~ This happens because `rhs` and `lval` are not scoped in the case statement so it could fall through to the next case. The solution is to scope them which this commit now does by adding a separate scope for `OP_SASSIGN` (similar to `OP_AASSIGN). Fixes Perl#20108
Code in 9fdd7fc broke the g++ builds, Basically after the commit the code looked like: switch (o->op_type) { ... case OP_SASSIGN: ... OP* rhs = cBINOPx(o)->op_first; OP* lval = cBINOPx(o)->op_last; ... break; case OP_AASSIGN: { g++ does not allow this and errors with: peep.c:3897:14: error: jump to case label 3897 | case OP_AASSIGN: { | ^~~~~~~~~~ peep.c:3844:17: note: crosses initialization of 'OP* lval' 3844 | OP* lval = cBINOPx(o)->op_last; | ^~~~ peep.c:3843:17: note: crosses initialization of 'OP* rhs' 3843 | OP* rhs = cBINOPx(o)->op_first; | ^~~ This happens because `rhs` and `lval` are not scoped in the case statement so it could fall through to the next case. The solution is to scope them which this commit now does by adding a separate scope for `OP_SASSIGN` (similar to `OP_AASSIGN). Fixes Perl#20108
Code in 9fdd7fc broke the g++ builds, Basically after the commit the code looked like: switch (o->op_type) { ... case OP_SASSIGN: ... OP* rhs = cBINOPx(o)->op_first; OP* lval = cBINOPx(o)->op_last; ... break; case OP_AASSIGN: { g++ does not allow this and errors with: peep.c:3897:14: error: jump to case label 3897 | case OP_AASSIGN: { | ^~~~~~~~~~ peep.c:3844:17: note: crosses initialization of 'OP* lval' 3844 | OP* lval = cBINOPx(o)->op_last; | ^~~~ peep.c:3843:17: note: crosses initialization of 'OP* rhs' 3843 | OP* rhs = cBINOPx(o)->op_first; | ^~~ This happens because `rhs` and `lval` are not scoped in the case statement so it could fall through to the next case. The solution is to scope them which this commit now does by adding a separate scope for `OP_SASSIGN` (similar to `OP_AASSIGN`). Fixes Perl#20108
Code in 9fdd7fc broke the g++ builds, Basically after the commit the code looked like: switch (o->op_type) { ... case OP_SASSIGN: ... OP* rhs = cBINOPx(o)->op_first; OP* lval = cBINOPx(o)->op_last; ... break; case OP_AASSIGN: { g++ does not allow this and errors with: peep.c:3897:14: error: jump to case label 3897 | case OP_AASSIGN: { | ^~~~~~~~~~ peep.c:3844:17: note: crosses initialization of 'OP* lval' 3844 | OP* lval = cBINOPx(o)->op_last; | ^~~~ peep.c:3843:17: note: crosses initialization of 'OP* rhs' 3843 | OP* rhs = cBINOPx(o)->op_first; | ^~~ This happens because `rhs` and `lval` are not scoped in the case statement so it could fall through to the next case. The solution is to scope them which this commit now does by adding a separate scope for `OP_SASSIGN` (similar to `OP_AASSIGN`). Fixes #20108
Repair confirmed with a build on FreeBSD with this invocation:
|
Code in 9fdd7fc broke the g++ builds, Basically after the commit the code looked like: switch (o->op_type) { ... case OP_SASSIGN: ... OP* rhs = cBINOPx(o)->op_first; OP* lval = cBINOPx(o)->op_last; ... break; case OP_AASSIGN: { g++ does not allow this and errors with: peep.c:3897:14: error: jump to case label 3897 | case OP_AASSIGN: { | ^~~~~~~~~~ peep.c:3844:17: note: crosses initialization of 'OP* lval' 3844 | OP* lval = cBINOPx(o)->op_last; | ^~~~ peep.c:3843:17: note: crosses initialization of 'OP* rhs' 3843 | OP* rhs = cBINOPx(o)->op_first; | ^~~ This happens because `rhs` and `lval` are not scoped in the case statement so it could fall through to the next case. The solution is to scope them which this commit now does by adding a separate scope for `OP_SASSIGN` (similar to `OP_AASSIGN`). Fixes Perl#20108
A recent commit to blead has broken the build when using
g++
as the C-compiler.I first noticed this breakage in recent smoke-test reports such as this one.
Bisecting with this invocation:
... points to this commit:
@richardleach, can you take a look?
@neilb, can you keep an eye on this, as it will affect the monthly dev release scheduled for Saturday Aug 20? Thanks.
The text was updated successfully, but these errors were encountered: