← Back to team overview

kicad-developers team mailing list archive

Re: fixing pointer bugs in 64 bit

 

2009/7/18 jean-pierre.charras@...
<jean-pierre.charras@...>:
>
>
> Vesa Solonen a écrit :
>
>
>
> Hi,
>
> I came across a problem in dialog_design_ rules.cpp on lines 441 and 462
> where a pointer is truncated to 32 bit int. Breaks 64 bit at once. I don't
> know the proper way of handling it, but there ought to be one. No project
> should make that kind of assumptions about address space these days.
> Anyway my current fix was just to put unsigned long there, but someone who
> has the knowledge should fix it for real.
>
> -Vesa
>
> Do not worry about this.
> in dialog_design_ rules.cpp, the data pointer is *not* used as a pointer,
> but only as an index (an unsigned integer value, in fact)
> the assumptions I made is a pointer is like an unsigned integer value; and
> 32 is enought to count the amount of nets in a board.
>
> I do not think this can creates a problem.
>
> --
> Jean-Pierre CHARRAS
>

Hello,

===

f3nix@spider:~/devel/kicad/kicad-sf.net/svn/trunk/kicad/build/release$
make rebuild_cache && time make
Running CMake to regenerate build system...
-- Check for installed OpenGL -- found
-- Check for installed Boost -- found
-- Check for installed wxWidgets -- found
-- Kicad SVN version: (20090718 SVN-R1880)
-- Kicad about version: SVN-R1880 (20090718)
-- Check for installed zlib -- found
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/f3nix/devel/kicad/kicad-sf.net/svn/trunk/kicad/build/release
[ 0%] Built target 3d-viewer
[ 66%] Built target bitmaps
[ 69%] Built target common
[ 72%] Built target pcbcommon
[ 73%] Built target kbool
[ 74%] Built target polygon
[ 76%] Built target cvpcb
[ 85%] Built target eeschema
[ 85%] Built target netlist_form_pads-pcb
[ 88%] Built target gerbview
[ 88%] Built target kicad
[ 89%] Built target minizip
[ 89%] Building CXX object
pcbnew/CMakeFiles/pcbnew.dir/dialog_design_rules.cpp.o
/home/f3nix/devel/kicad/kicad-sf.net/svn/trunk/kicad/pcbnew/dialog_design_rules.cpp:
In member function ‘virtual void
DIALOG_DESIGN_RULES::OnRightToLeftCopyButton(wxCommandEvent&)’:
/home/f3nix/devel/kicad/kicad-sf.net/svn/trunk/kicad/pcbnew/dialog_design_rules.cpp:477:
error: cast from ‘void*’ to ‘unsigned int’ loses precision
/home/f3nix/devel/kicad/kicad-sf.net/svn/trunk/kicad/pcbnew/dialog_design_rules.cpp:
In member function ‘virtual void
DIALOG_DESIGN_RULES::OnLeftToRightCopyButton(wxCommandEvent&)’:
/home/f3nix/devel/kicad/kicad-sf.net/svn/trunk/kicad/pcbnew/dialog_design_rules.cpp:500:
error: cast from ‘void*’ to ‘unsigned int’ loses precision
make[2]: *** [pcbnew/CMakeFiles/pcbnew.dir/dialog_design_rules.cpp.o] Error1
make[1]: *** [pcbnew/CMakeFiles/pcbnew.dir/all] Error 2
make: *** [all] Error 2

real 0m4.575s
user 0m2.484s
sys 0m0.644s
f3nix@spider:~/devel/kicad/kicad-sf.net/svn/trunk/kicad/build/release$

===

f3nix@spider:~/devel/kicad/kicad-sf.net/svn/trunk/kicad/build/release$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.3.3-14' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.3 (Debian 4.3.3-14)
f3nix@spider:~/devel/kicad/kicad-sf.net/svn/trunk/kicad/build/release$

===

Cheers,
Mateusz

-- 
AKA f3nix AKA metyl AKA skowri ;)






References