WARNS=3 and C++ on 8.x

Alexander Kabaev kabaev at gmail.com
Thu Dec 20 05:01:49 PST 2007


On Wed, 19 Dec 2007 19:49:43 -0500
Mikhail Teterin <mi+mill at aldan.algebra.com> wrote:

> Hello!
> 
> The graphics/libfpx port can not currently be built on 8.x, because
> the WARNS=3, which is set in files/Makefile.bsd triggers
> -Wsystem-headers.
> 
> That setting triggers the following warning:
> 
> In file included from /usr/include/c++/4.2/ios:50,
>                  from /usr/include/c++/4.2/ostream:45,
>                  from /usr/include/c++/4.2/iostream:45,
>                  from /work/a/ports/graphics/libfpx/work/libfpx-1.2.0.12/ole/olestorg.cpp:20:
> /usr/include/c++/4.2/bits/basic_ios.h: In member function 'void
> std::basic_ios<_CharT,
> _Traits>::_M_setstate(std::_Ios_Iostate)': /usr/include/c++/4.2/bits/basic_ios.h:156:
> warning: empty body in an if-statement
> 
> The port builds fine on 7.x and 6.x. Could the 8.x, please, be fixed?
> I mean, the setting, pretty much, assures, that ALL C++ software can't
> be built (with WARNS=3, that is), because almost everything uses
> iostream.
> 
> Thanks!
> 
>  -mi

The code below is from /usr/include/c++/4.2/exception_defines.h and as
you can see, WARNS3 alone is not enough, -fno-exceptions has to be on
the command line too, something you forgot to mention. There's nothing
to fix in FreeBSD itself, the change should go into vendor sources. 


#ifndef __EXCEPTIONS
// Iff -fno-exceptions, transform error handling code to work without
it. # define try      if (true)
# define catch(X) if (false)
# define __throw_exception_again
#else
// Else proceed normally.
# define __throw_exception_again throw
#endif




-- 
Alexander Kabaev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20071220/6271ddf5/signature.pgp


More information about the freebsd-current mailing list