Skip to content

libssh2: delete duplicate break#15384

Closed
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:libssh2-del-dupe-break
Closed

libssh2: delete duplicate break#15384
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:libssh2-del-dupe-break

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Oct 23, 2024

lib/vssh/libssh2.c:2495:7: warning: 'break' will never be executed [-Wunreachable-code-break]
      break;
      ^~~~~

CI did not catch it due to llvm skipping this check for all #included
files. It's designed this way to avoid performance issues and false
positive when checking headers:
llvm/llvm-project#71046

```
lib/vssh/libssh2.c:2495:7: warning: 'break' will never be executed [-Wunreachable-code-break]
      break;
      ^~~~~
```
@vszakats vszakats changed the title libssh2: delete duplicate break; libssh2: delete duplicate break Oct 23, 2024
@vszakats vszakats closed this in 7c023c3 Oct 23, 2024
@vszakats vszakats deleted the libssh2-del-dupe-break branch October 23, 2024 17:36
vszakats added a commit to vszakats/curl that referenced this pull request Oct 25, 2024
This warning remains silent in unity builds. Since we're using unity
build in CI for most jobs, warnings remain undetected there.
Disable them for all builds to avoid a surprise warning outside our CI.

The issue caught by the warning is useful for a tidy codebase, but
doesn't affect executed code. It was enabled in
84338c4 curl#12331 (2023-11-15).

llvm source: https://github.com/llvm/llvm-project/blob/fee2953f23bd8a8a71e574e6a8db08033778d3a4/clang/lib/Sema/AnalysisBasedWarnings.cpp#L125-L134
llvm issue: llvm/llvm-project#71046

Follow-up to 7c023c3 curl#15384
vszakats added a commit that referenced this pull request Oct 27, 2024
This warning remains silent in unity builds. Since we're using unity
in CI for most jobs, warnings remain undetected there.
Disable them for all builds to avoid a surprise warning outside our CI.

The issue caught by the warning is useful for a tidy codebase, but
doesn't affect executed code. It was enabled in
84338c4 #12331 (2023-11-15).

llvm source: https://github.com/llvm/llvm-project/blob/fee2953f23bd8a8a71e574e6a8db08033778d3a4/clang/lib/Sema/AnalysisBasedWarnings.cpp#L125-L134
llvm issue: llvm/llvm-project#71046

Follow-up to 7c023c3 #15384
Closes #15416
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
```
lib/vssh/libssh2.c:2495:7: warning: 'break' will never be executed [-Wunreachable-code-break]
      break;
      ^~~~~
```

CI did not catch it due to llvm skipping this check for all #included
files. It's designed this way to avoid performance issues and false
positive when checking headers:
llvm/llvm-project#71046

Closes curl#15384
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
This warning remains silent in unity builds. Since we're using unity
in CI for most jobs, warnings remain undetected there.
Disable them for all builds to avoid a surprise warning outside our CI.

The issue caught by the warning is useful for a tidy codebase, but
doesn't affect executed code. It was enabled in
84338c4 curl#12331 (2023-11-15).

llvm source: https://github.com/llvm/llvm-project/blob/fee2953f23bd8a8a71e574e6a8db08033778d3a4/clang/lib/Sema/AnalysisBasedWarnings.cpp#L125-L134
llvm issue: llvm/llvm-project#71046

Follow-up to 7c023c3 curl#15384
Closes curl#15416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant