Fix Clang 16 errors for invalid C99 constructs (-Wincompatible-pointer-types) #108

Closed
BratishkaErik wants to merge 0 commits from (deleted):clang-c99-fixes into master
First-time contributor

These errors were caused by t_title function having "void" parameter
instead of "ui_tab_t *tab", like everywhere else:

src/uit_conn.c:398:41: error: initialization of char * (*)(ui_tab_t *) from incompatible pointer type char * (*)(void) [-Wincompatible-pointer-types]
  398 | ui_tab_type_t uit_conn[1] = { { t_draw, t_title, t_key, t_close } };
      |                                         ^~~~~~~

Also renamed t param in t_title of "src/uit_main.c" to tab,
for consistency with other functions.

This error appeared only in 1.24 release cycle, because changing
prototypes from "()" to "(void)" in 2cf47a7ec9
changed meaning of the type from "any parameters, including ui_tab_t *"
to "no parameters at all", and this is where Clang starts to complain.

Bug: https://bugs.gentoo.org/928946
Signed-off-by: Eric Joldasov bratishkaerik@landless-city.net

These errors were caused by `t_title` function having "void" parameter instead of "ui_tab_t *tab", like everywhere else: ``` src/uit_conn.c:398:41: error: initialization of char * (*)(ui_tab_t *) from incompatible pointer type char * (*)(void) [-Wincompatible-pointer-types] 398 | ui_tab_type_t uit_conn[1] = { { t_draw, t_title, t_key, t_close } }; | ^~~~~~~ ``` Also renamed `t` param in `t_title` of "src/uit_main.c" to `tab`, for consistency with other functions. This error appeared only in 1.24 release cycle, because changing prototypes from "()" to "(void)" in 2cf47a7ec9 changed meaning of the type from "any parameters, including ui_tab_t *" to "no parameters at all", and this is where Clang starts to complain. Bug: https://bugs.gentoo.org/928946 Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
BratishkaErik added 1 commit 2024-04-08 21:19:10 +02:00
These errors were caused by `t_title` function having "void" parameter
instead of "ui_tab_t *tab", like everywhere else:

```
src/uit_conn.c:398:41: error: initialization of char * (*)(ui_tab_t *) from incompatible pointer type char * (*)(void) [-Wincompatible-pointer-types]
  398 | ui_tab_type_t uit_conn[1] = { { t_draw, t_title, t_key, t_close } };
      |                                         ^~~~~~~
```

Also renamed `t` param in `t_title` of "src/uit_main.c" to `tab`,
for consistency with other functions.

Reported in https://bugs.gentoo.org/928946 .

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
BratishkaErik force-pushed clang-c99-fixes from dc7a158aa7 to 42590da474 2024-04-08 21:36:15 +02:00 Compare
Author
First-time contributor

Only changed commit message, I hope it's a little bit more readable now.

Only changed commit message, I hope it's a little bit more readable now.
Owner

Welp, some sloppy coding on my part. Pulled, thanks.

Welp, some sloppy coding on my part. Pulled, thanks.
yorhel closed this pull request 2024-04-09 08:04:25 +02:00
Author
First-time contributor

Thanks!

Thanks!
BratishkaErik deleted branch clang-c99-fixes 2024-04-09 08:09:51 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
imported
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: yorhel/ncdc#108
No description provided.