Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2007 08:01:27 -0500
From:      Alexander Kabaev <kabaev@gmail.com>
Cc:        current@freebsd.org
Subject:   Re: WARNS=3 and C++ on 8.x
Message-ID:  <20071220080127.2e0a5a1b@kan.dnsalias.net>
In-Reply-To: <200712191949.43414.mi%2Bmill@aldan.algebra.com>
References:  <200712191949.43414.mi%2Bmill@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/Wbn=UgdrFY4H/Pd82MAXMBw
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

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

> Hello!
>=20
> The graphics/libfpx port can not currently be built on 8.x, because
> the WARNS=3D3, which is set in files/Makefile.bsd triggers
> -Wsystem-headers.
>=20
> That setting triggers the following warning:
>=20
> 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/basi=
c_ios.h:156:
> warning: empty body in an if-statement
>=20
> 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=3D3, that is), because almost everything uses
> iostream.
>=20
> Thanks!
>=20
>  -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.=20


#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




--=20
Alexander Kabaev

--Sig_/Wbn=UgdrFY4H/Pd82MAXMBw
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFHamenQ6z1jMm+XZYRAsHTAJ9+34WGI/UGj0KudJLYcEbPkC8H5wCfVhW1
dCy4RYKBevLsVbrLYw1BSPg=
=gtR2
-----END PGP SIGNATURE-----

--Sig_/Wbn=UgdrFY4H/Pd82MAXMBw--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071220080127.2e0a5a1b>