ascii-boxes / boxes

Command line ASCII boxes unlimited!
https://boxes.thomasjensen.com/
GNU General Public License v3.0
613 stars 75 forks source link

Build fails with clang 16 #106

Closed Schievel1 closed 2 years ago

Schievel1 commented 2 years ago

A clear and concise description of what the bug is.

Clang 16 will introduce a set of standard settings that will not allow function prototypes to be declared without their arguments. To simulate clang 16 behavior I set

-Werror=implicit-function-declaration -Werror=implict-int -Werror=incompatible-function-pointer-types

in `/etc/clang/clang-stricter.cfg and use clang15

Then, during build I get

../src/boxes.c:379:17: error: passing arguments to 'output_input' without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]

The problem is the prototype of function output_input in src/remove.h: https://github.com/ascii-boxes/boxes/blob/61562b0158dd27aabb8020a16b62a625ae4fc13c/src/remove.h#L25

If you change it to a proper C2x prototype like this void output_input(const int trim_only); clang16 is happy.

Environment (please complete the following information):

tsjensen commented 2 years ago

Thanks for bringing this up!

We should change this. Do you want to do a PR?

Schievel1 commented 2 years ago

Thanks for bringing this up!

We should change this. Do you want to do a PR?

Yeah sure, I will send you a patch since I already made one for the package on gentoo