keynav
keynav copied to clipboard
Fix compiler warning: implicit declaration of asprintf
Currently, compiling on GNU/Linux systems throws, "keynav.c:376:9: warning: implicit declaration of function 'asprintf'". This does not break the build and does not appear on FreeBSD. It appears that asprintf is a GNU extension also implemented by some or all BSDs. There are two ways to resolve this: We can either 1. refactor the code to not use asprintf (it appears that its functionality can be replaced with calloc+sprintf), or 2. just say that we're using GNU extensions (this is done by one other keynav fork; see https://github.com/dradetsky/keynav/commit/247d1a6f1d9dd561f3f6f24f7dde050ac055497f)
Using #define _GNU_SOURCE
does compile fine on FreeBSD at least, but it is still a non-standard extension not defined by C or POSIX.
Oh, it will matter; according to jordansissel, "asprintf is not available on Solaris (by default)".
(see https://github.com/jordansissel/keynav/pull/23)