The Fedora project is building all packages with link-time optimization (LTO) for Fedora 33 and later. While building bigloo with LTO, gcc emitted a number of warnings about mismatched declarations and definitions. This patch fixes most of them. There are a couple more, but I have reason to suspect that you won't like my solutions for those, so they will be separate pull requests. The reasons for each change:
bgl_snd_rawmidi_isdir: the Scheme code only passes 3 integer arguments, not including card, which the C code doesn't use anyway. Remove it and add a prototype to catch further such problems.
bgl_avahi_error: fix disagreement about the return type
bgl_uv_timer_cb: the libuv timer callback only takes one argument, the handle, in libuv 1.40.0. I have not checked earlier versions of libuv.
uv-handle-type-symbol: bgl_uv_handle_type_symbol takes a long parameter ... but maybe that's wrong. Should it really be int?
bgl_mpg123_info and bgl_mpg123_getparam: both functions call bgl_mpg123_error with a 4th argument of the wrong type.
bgl_mpg123_error: fix disagreement about the return type and specify the parameter types.
bgl_phidget_encoder_get_input_count and bgl_phidget_encoder_get_encoder_count: the Scheme code does not pass the "i" argument, which the C code ignores anyway.
bglphidget.h: add many missing prototypes.
phidget-encoder-enable! and phidget-encoder-disable!: both functions end by calling a C function that returns void. Add an explicit return value to make the compiler happy.
bgl_pulseaudio_error: fix disagreement about the return type and specify the parameter types.
callcc_restore_stack: specify the parameter types.
cerror.c: the glibc declarations of perror, strerror, and exit are different from these prototypes. For example, the glibc declaration of exit is extern void exit (int __status) __THROW __attribute__ ((__noreturn__));. Include the relevant headers instead.
string_to_obj: specify the parameter types.
cref and memshow: specify the parameter types, and fix disagreement about cref's return type.
As above, the glibc declaration of getenv differs from the one in cmain.c (it is extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur;). Include the relevant header instead.
make_string: fix disagreement about the type of the first parameter.
cports.c: yet another differing glibc declaration, for sendfile this time. Include the relevant header instead.
bgl_syswrite: fix disagreement about the type of the 2nd parameter
dup and close: more prototypes that differ from glibc's. Include the relevant header instead.
I changed my mind on uv-handle-type-symbol / bgl_uv_handle_type_symbol. The parameter is really an enum, which means it is implemented as an int, so I changed the two uses of long to int instead.
The Fedora project is building all packages with link-time optimization (LTO) for Fedora 33 and later. While building bigloo with LTO, gcc emitted a number of warnings about mismatched declarations and definitions. This patch fixes most of them. There are a couple more, but I have reason to suspect that you won't like my solutions for those, so they will be separate pull requests. The reasons for each change:
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
. Include the relevant headers instead.extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur;
). Include the relevant header instead.Let me know if you would like any changes.