Skip to content

Conversation

@AMDmi3
Copy link
Contributor

@AMDmi3 AMDmi3 commented Apr 17, 2025

  • Use void for functions which take no arguments, as per C standard. This also fixes warnings with clang 18
  • Fix prototype of keyboard_event which misses an argument

@mpereira mpereira merged commit 8d55e4b into mpereira:master Apr 17, 2025
@mpereira
Copy link
Owner

Nice, I had just noticed the warnings.

@mpereira
Copy link
Owner

@AMDmi3 let me know if you need anything else in, otherwise I'll cut a new release with your last 2 PRs.

@AMDmi3
Copy link
Contributor Author

AMDmi3 commented Apr 17, 2025

I'm done for now, these fix all but one warnings on FreeBSD and allow to get rid of a local patch.

The remaining warning is

src/ttysolitaire.c:37:18: warning: '_Generic' is a C11 extension [-Wc11-extensions]
   37 |   program_name = basename(argv[0]);
      |                  ^
/usr/include/libgen.h:60:21: note: expanded from macro 'basename'
   60 | #define basename(x)     __generic(x, const char *, __old_basename, basename)(x)
      |                         ^
/usr/include/sys/cdefs.h:314:2: note: expanded from macro '__generic'
  314 |         _Generic(expr, t: yes, default: no)
      |         ^
1 warning generated.

and it looks like it originates in FreeBSD's include (however I'd consider switching the project to C11).

Also I'm willing to contribute GitHub Actions based CI, would you be interested?

@AMDmi3 AMDmi3 deleted the function-prototypes branch April 17, 2025 16:09
@mpereira
Copy link
Owner

I'm done for now, these fix all but one warnings on FreeBSD and allow to get rid of a local patch.

Here you go: https://github.com/mpereira/tty-solitaire/releases/tag/v1.4.1

The remaining warning is

src/ttysolitaire.c:37:18: warning: '_Generic' is a C11 extension [-Wc11-extensions]
   37 |   program_name = basename(argv[0]);
      |                  ^
/usr/include/libgen.h:60:21: note: expanded from macro 'basename'
   60 | #define basename(x)     __generic(x, const char *, __old_basename, basename)(x)
      |                         ^
/usr/include/sys/cdefs.h:314:2: note: expanded from macro '__generic'
  314 |         _Generic(expr, t: yes, default: no)
      |         ^
1 warning generated.

and it looks like it originates in FreeBSD's include (however I'd consider switching the project to C11).

Yeah, I don't get that on macOS.

Also I'm willing to contribute GitHub Actions based CI, would you be interested?

Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants