Compiler more strict on 12 with r320337 ?

Dimitry Andric dim at FreeBSD.org
Tue Jun 27 11:45:47 UTC 2017


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20170627/02954306/attachment.sig>


More information about the freebsd-current mailing list