Skip to content

Ticket #5113: fix build due to C23 string function prototype changes#5113

Merged
zyv merged 6 commits intomasterfrom
fix-c23-strchr
May 9, 2026
Merged

Ticket #5113: fix build due to C23 string function prototype changes#5113
zyv merged 6 commits intomasterfrom
fix-c23-strchr

Conversation

@zyv
Copy link
Copy Markdown
Member

@zyv zyv commented May 5, 2026

I just want to unblock the CI, so that I can merge PRs. Therefore, I'm not rewriting the code to make it better, but just trying to make sure that it remains correct and functions like it was before.

The part about extfs_find_entry_int I find particularly disgusting. Apparently, this function was modifying strings passed to it through pointer trickery without the callers even knowing. I don't know of a simple way to fix this without rewriting other than just making a copy of the incoming string. The whole logic of this function doesn't make sense to me.

Blocking:

zyv added 5 commits May 5, 2026 09:46
…prototype change

```
path.c: In function 'vfs_path_from_str_deprecated_parser':
path.c:360:20: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  360 |         url_params = strchr (op, ':');  // skip VFS prefix
      |                    ^
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
```
replace.c: In function 'str_replace_all':
replace.c:69:27: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
   69 |     while ((needle_in_str = strstr (haystack, needle)) != NULL)
      |                           ^
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
```
serialize.c: In function 'mc_deserialize_str':
serialize.c:155:18: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  155 |         semi_ptr = strchr (data + 1, SRLZ_DELIM_C);
      |                  ^
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
```
find.c: In function 'find_ignore_dir_search':
find.c:1174:19: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 1174 |                 d = strstr (dir, *ignore_dir);
      |                   ^
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
```
panel.c: In function 'chdir_other_panel':
panel.c:2976:20: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 2976 |         curr_entry = strrchr (vfs_path_get_last_path_str (panel->cwd_vpath), PATH_SEP);
      |                    ^
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
@zyv zyv requested a review from mc-worker May 5, 2026 08:53
@github-actions github-actions Bot added the needs triage Needs triage by maintainers label May 5, 2026
@github-actions github-actions Bot added this to the Future Releases milestone May 5, 2026
@github-actions github-actions Bot added the prio: medium Has the potential to affect progress label May 5, 2026
@zyv zyv self-assigned this May 5, 2026
@zyv zyv added area: core Issues not related to a specific subsystem prio: blocker This problem will block progress and removed prio: medium Has the potential to affect progress needs triage Needs triage by maintainers labels May 5, 2026
@zyv zyv modified the milestones: Future Releases, 4.9.0 May 5, 2026
@zyv zyv changed the title Fix build due to C23 string function prototype changes Ticket #5113: fix build due to C23 string function prototype changes May 5, 2026
@zyv
Copy link
Copy Markdown
Member Author

zyv commented May 9, 2026

@mc-worker, could you please have a look and fix it directly if you don't like something?

@zyv
Copy link
Copy Markdown
Member Author

zyv commented May 9, 2026

/rebase

```
extfs.c: In function 'extfs_find_entry_int':
extfs.c:254:11: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  254 |         q = strchr (p, PATH_SEP);
      |           ^
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
@zyv zyv merged commit 3ef65b7 into master May 9, 2026
17 checks passed
@zyv zyv deleted the fix-c23-strchr branch May 9, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues not related to a specific subsystem prio: blocker This problem will block progress

Development

Successfully merging this pull request may close these issues.

2 participants