CLANG versus GCC question: compiling non-c99 code with CLANG
(clang dumps error)
Dimitry Andric
dimitry at andric.com
Mon Sep 24 11:57:04 UTC 2012
On 2012-09-24 13:45, O. Hartmann wrote:
...
> here it is:
>
> win.c:796:50: error: non-void function 'lux_freedata' should return a
> value [-Wreturn-type]
> if ( current->win.data == (lux_data *)NULL ) return;
> ^
Some time ago, the clang developers upgraded this from a warning to an
error, which is fairly sensible for new code, but maybe not so for c89
and older.
I'm not sure if that was a handy choice, but in any case, you can work
around it by adding -Wno-return-type to CFLAGS.
> win.c:826:1: warning: type specifier missing, defaults to 'int'
> [-Wimplicit-int]
> lux_freewins()
> ^~~~~~~~~~~~
These warnings can all be ignored for K&R code. Or just add
-Wno-implicit-int to shut them up.
More information about the freebsd-current
mailing list