Re: Compiler more strict on 12 with r320337 ?

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 27 Jun 2017 13:45:26 +0200
On 27 Jun 2017, at 13:20, Kurt Jaeger <lists_at_opsec.eu> wrote:
> 
> Hi!
> 
>>> Compiling devel/lfcbase, it fails while including sys/socketvar.h with
>>> this error:
>>> 
>>> In file included from Net.cc:36:
>>> /usr/include/sys/socketvar.h:117:4: error: types cannot be declared in an
>>>     anonymous struct
>>>                       enum {
>>>                       ^
>>> 1 error generated.
>>> 
>>> Should sys/socketvar.h be included at all ?
>> 
>> Hi Kurt,
>> 	What compiler/CFLAGS (in particular, -std=<foo>) are you using to compile devel/lfcbase?
> 
> http://people.freebsd.org/~pi/logs/lfcbase.txt
> 
> says:
> 
> /bin/sh ../libtool  --tag=CXX    --mode=compile c++ -DHAVE_CONFIG_H  -I. -I..  -O3     -O2 -pipe -fstack-protector -fno-strict-aliasing -MT Net.lo -MD -MP -MF .deps/Net.Tpo -c -o Net.lo Net.cc

Ah, this is because you're compiling the header as C++.  Normally values
like SQ_NONE, SQ_INCOMP etc are defined as preprocessor macros, not enum
values.  Either that should be done, or define the enum should be
declared outside the struct.

-Dimitry


Received on Tue Jun 27 2017 - 09:45:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC