Skip to content

smb: constify strchr() result variable#22094

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:smbconst
Closed

smb: constify strchr() result variable#22094
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:smbconst

Conversation

@vszakats

@vszakats vszakats commented Jun 18, 2026

Copy link
Copy Markdown
Member

Fixing (as seen with gcc-15 on Ubuntu 26.04):

lib/smb.c: In function 'smb_connect':
lib/smb.c:491:9: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  491 |   slash = strchr(user, '/');
      |         ^
lib/smb.c:493:11: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  493 |     slash = strchr(user, '\\');
      |           ^

Ref: https://github.com/curl/curl/actions/runs/27778098314/job/82195462418?pr=22092

Follow-up to 4e59083 #20428
Follow-up to 7dc60bd #20425
Follow-up to 0e2507a #20421

Cherry-picked from #22092

Fixing:
```
../../lib/smb.c: In function 'smb_connect':
../../lib/smb.c:491:9: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  491 |   slash = strchr(user, '/');
      |         ^
../../lib/smb.c:493:11: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  493 |     slash = strchr(user, '\\');
      |           ^
```
Ref: https://github.com/curl/curl/actions/runs/27778098314/job/82195462418?pr=22092

Follow-up to 4e59083 curl#20428
Follow-up to 7dc60bd curl#20425
Follow-up to 0e2507a curl#20421
@vszakats vszakats closed this in e44f1a1 Jun 18, 2026
@vszakats vszakats deleted the smbconst branch June 18, 2026 19:12
vszakats added a commit that referenced this pull request Jun 25, 2026
In jobs that may benefit from newer tool versions (pyspelling, possibly
CodeQL, CM integration, configure-vs-cmake). Also curl-for-win to match
the curl/curl-for-win repo that also bumped. Bump some Linux jobs to add
variation. Also the rest of `check*` jobs for no particular reason other
than using the latest.

Follow-up to 8f5e4f0 #22097
Follow-up to 139ce4d #22096
Follow-up to e44f1a1 #22094

Closes #22092
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