Re: CLANG versus GCC question: compiling non-c99 code with CLANG (clang dumps error)

From: Dimitry Andric <dimitry_at_andric.com>
Date: Mon, 24 Sep 2012 13:57:00 +0200
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.
Received on Mon Sep 24 2012 - 09:57:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:30 UTC