x86_64-redhat-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -O2 -g -pipe -D_FORTIFY_SOURCE=2 -m64 -MT input.lo -MD -MP -MF .deps/input.Tpo -c input.c -fPIC -DPIC -o .libs/input.o input.c:96:42: macro "gets" passed 3 arguments, but takes just 1 input.c: In function `snd_input_gets': input.c:96: warning: return from incompatible pointer type Relevant code is: typedef struct _snd_input_ops { int (*close)(snd_input_t *input); int (*scan)(snd_input_t *input, const char *format, va_list args); char *(*gets)(snd_input_t *input, char *str, size_t size); int (*getch)(snd_input_t *input); int (*ungetch)(snd_input_t *input, int c); } snd_input_ops_t; struct _snd_input { snd_input_type_t type; snd_input_ops_t *ops; void *private_data; }; typedef struct _snd_input snd_input_t; char *snd_input_gets(snd_input_t *input, char *str, size_t size) { return input->ops->gets(input, str, size); }
Fixed in alsa-lib with a '#undef gets' in input.c Feel free to close if you don't want to be too liberal in accepting wacky code. :)
alsa-lib is broken: ISO C 99, 7.1.4: Any function declared in a header may be additionally implemented as a function-like macro defined in the header, so if a library function is declared explicitly when its header is included, one of the techniques shown below can be used to ensure the declaration is not affected by such a macro. Any macro definition of a function can be suppressed locally by enclosing the name of the function in parentheses, because the name is then not followed by the left parenthesis that indicates expansion of a macro function name. For the same syntactic reason, it is permitted to take the address of a library function even if it is also defined as a macro. The use of #undef to remove any macro definition will also ensure that an actual function is referred to. In this case, I think it would be better to char *(*(gets))(snd_input_t *input, char *str, size_t size); and return (input->ops->gets)(input, str, size); because that way instead of the #undef way if alsa-lib ever uses gets (str) function, it will turn a buffer overflow into just a DoS.
Fixed in CVS, will be in -7 or later.