← Back to team overview

kicad-developers team mailing list archive

Re: Call for help to compile a small test program with g++ version 4.7.3 and more.

 

I downloaded this file :
https://svn.boost.org/trac/boost/attachment/ticket/7983/test_polygon_diff.cpp

And compiled it on Debian 7 (Linux debian 3.2.0-4-686-pae #1 SMP
Debian 3.2.41-2+deb7u2 i686 GNU/Linux)
With this info on the C compiler :
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--enable-targets=all --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)

And it does not compile.

gcc test.cpp
In file included from /usr/include/boost/polygon/polygon.hpp:64:0,
                 from test.cpp:12:
/usr/include/boost/polygon/polygon_90_set_data.hpp: In instantiation
of ‘void boost::polygon::polygon_90_set_data<T>::sort() const [with T
= int]’:
/usr/include/boost/polygon/polygon_45_set_data.hpp:1550:7:   required
from ‘void boost::polygon::polygon_45_set_data<Unit>::applyAdaptiveBoolean_(boost::polygon::polygon_45_set_data<Unit>&,
const boost::polygon::polygon_45_set_data<Unit>&) const [with int op =
3; Unit = int]’
/usr/include/boost/polygon/detail/polygon_set_view.hpp:108:9:
required from ‘void boost::polygon::execute_boolean_op(value_type&,
const geometry_type_1&, const geometry_type_2&) [with value_type =
boost::polygon::polygon_set_data<int>; geometry_type_1 =
std::vector<boost::polygon::polygon_data<int> >; geometry_type_2 =
std::vector<boost::polygon::polygon_data<int> >; int op_type = 3]’
/usr/include/boost/polygon/detail/polygon_set_view.hpp:197:5:
required from ‘geometry_type_1&
boost::polygon::self_assignment_boolean_op(geometry_type_1&, const
geometry_type_2&) [with geometry_type_1 =
std::vector<boost::polygon::polygon_data<int> >; geometry_type_2 =
std::vector<boost::polygon::polygon_data<int> >; int op_type = 3]’
/usr/include/boost/polygon/polygon_set_concept.hpp:440:90:   required
from ‘typename boost::enable_if<typename
boost::polygon::gtl_and_3<boost::polygon::operators::yes_ps_ome,
typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type,
typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type,
geometry_type_1>::type&
boost::polygon::operators::operator-=(geometry_type_1&, const
geometry_type_2&) [with geometry_type_1 =
std::vector<boost::polygon::polygon_data<int> >; geometry_type_2 =
std::vector<boost::polygon::polygon_data<int> >; typename
boost::enable_if<typename
boost::polygon::gtl_and_3<boost::polygon::operators::yes_ps_ome,
typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type,
typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type,
geometry_type_1>::type = std::vector<boost::polygon::polygon_data<int>
>]’
test.cpp:107:19:   required from here
/usr/include/boost/polygon/polygon_90_set_data.hpp:299:9: error:
‘gtlsort’ was not declared in this scope, and no declarations were
found by argument-dependent lookup at the point of instantiation
[-fpermissive]
In file included from /usr/include/boost/polygon/detail/scan_arbitrary.hpp:13:0,
                 from /usr/include/boost/polygon/polygon_set_data.hpp:929,
                 from /usr/include/boost/polygon/polygon.hpp:82,
                 from test.cpp:12:
/usr/include/boost/polygon/detail/polygon_sort_adaptor.hpp:58:10:
note: ‘template<class iter_type, class pred_type> void
boost::polygon::gtlsort(iter_type, iter_type, const pred_type&)’
declared here, later in the translation unit

The boos version is : default Debian 7, 1.49.0.1

Maybe this helps somewhat?



Greetings,
Edwin van den Oetelaar



On Mon, Jun 17, 2013 at 3:21 PM, Dick Hollenbeck <dick@xxxxxxxxxxx> wrote:
>
> On Jun 17, 2013 6:21 AM, "Brian Sidebotham" <brian.sidebotham@xxxxxxxxx>
> wrote:
>>
>> On 17 June 2013 11:59, Dick Hollenbeck <dick@xxxxxxxxxxx> wrote:
>>>
>>>
>>> On Jun 17, 2013 5:02 AM, "Milan Horák" <stranger@xxxxxxxxxx> wrote:
>>> >
>>> > Hello,
>>> >
>>> > I am getting:
>>> >
>>> > g++ -Wall -O2 -I /g/boost_1_53_0 test_polygon_diff.cpp
>>> >
>>> > test_polygon_diff.cpp: In function ‘void dumpPolySet(const
>>> > KI_POLYGON_SET&)’:
>>> > test_polygon_diff.cpp:84:60: warning: format ‘%d’ expects argument of
>>> > type ‘int’, but argument 2 has type
>>> > ‘std::vector<boost::polygon::polygon_data<int> >::size_type {aka long
>>> > unsigned int}’ [-Wformat]
>>> > test_polygon_diff.cpp:88:71: warning: format ‘%d’ expects argument of
>>> > type ‘int’, but argument 3 has type ‘std::size_t {aka long unsigned int}’
>>> > [-Wformat]
>>> >
>>> > Am I doing something wrong?
>>>
>>> No.
>>>
>>> size_t is 64 bits on a 64 bit platform while int on that same platform is
>>> 32 bits even though it's a 64 bit program.
>>>
>>> This is why I don't use size_t by choice.  But for function return values
>>> like this %zd works well.
>>>
>>> The z modifier is designed for use with size_t.
>>>
>>>
>> Ah nice, I didn't know about the %z formatter.
>
> Modifier, so its %zd not %z.
>
> Or you can cast the argument down to 32 bits since 2 or 4 billion is usually
> enough of stuff.
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>


Follow ups

References