midicomp icon indicating copy to clipboard operation
midicomp copied to clipboard

Fix incorrect and nonstandard use of error()

Open nmlgc opened this issue 1 year ago • 0 comments

The error() function is defined nowhere in this codebase. When linking against glibc, the declaration will match the nonstandard error(3) function, but midicomp only ever passes a single const char* to this function, which doesn't match its 3+-parameter signature. Consequently, this code fails to link with any other libc, and doesn't correctly show the respective errors even with glibc.

Using prs_error() fixes these issues, allows this code to be compiled with MinGW, and retains the line number in the now correct error output.

nmlgc avatar Feb 17 '24 19:02 nmlgc