libftdi Archives

Subject: Re: Warning in Python wrapper

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sun, 13 Jan 2013 20:28:10 +0800
On Sun, Jan 13, 2013 at 11:44 AM, Matthias Janke
<matthias.janke@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi all,
>
> compiling (gcc 4.7.2) the python wrapper leads to the following warning:
>
> libftdi/build/bindings/ftdi1PYTHON_wrap.c: In function
> 'SWIG_InitializeModule':
> libftdi/build/bindings/ftdi1PYTHON_wrap.c:12294:3: warning: statement
> with no effect [-Wunused-value]
>
> is this harmless?
>

I got similar warnings under Linux. It seems to be harmless.

But I got problems under Mac OS X with the Python wrapper.

1) Under Linux; Ubuntu 12.10
mcuee@Ubuntu1210VM:~/Desktop/build/libftdi/libftdi/build$ make
[  4%] Generating doc/html/index.html
warning: Tag `SHOW_DIRECTORIES' at line 519 of file
/home/mcuee/Desktop/build/libftdi/libftdi/build/Doxyfile has become
obsolete.
To avoid this warning please remove this line from your configuration
file or upgrade it using "doxygen -u"
warning: Tag `HTML_ALIGN_MEMBERS' at line 906 of file
/home/mcuee/Desktop/build/libftdi/libftdi/build/Doxyfile has become
obsolete.
To avoid this warning please remove this line from your configuration
file or upgrade it using "doxygen -u"
warning: Tag `USE_INLINE_TREES' at line 1093 of file
/home/mcuee/Desktop/build/libftdi/libftdi/build/Doxyfile has become
obsolete.
To avoid this warning please remove this line from your configuration
file or upgrade it using "doxygen -u"
[  4%] Built target docs
[  8%] Building C object src/CMakeFiles/ftdi1.dir/ftdi.c.o
[ 12%] Building C object src/CMakeFiles/ftdi1.dir/ftdi_stream.c.o
Linking C shared library libftdi1.so
[ 12%] Built target ftdi1
[ 16%] Building C object src/CMakeFiles/ftdi1-static.dir/ftdi.c.o
[ 20%] Building C object src/CMakeFiles/ftdi1-static.dir/ftdi_stream.c.o
Linking C static library libftdi1.a
[ 20%] Built target ftdi1-static
[ 24%] Building CXX object ftdipp/CMakeFiles/ftdipp1.dir/ftdi.cpp.o
Linking CXX shared library libftdipp1.so
[ 24%] Built target ftdipp1
[ 28%] Building CXX object ftdipp/CMakeFiles/ftdipp1-static.dir/ftdi.cpp.o
Linking CXX static library libftdipp1.a
[ 28%] Built target ftdipp1-static
[ 32%] Generating ../doc/xml/ftdi_8c.xml
warning: Tag `SHOW_DIRECTORIES' at line 523 of file Doxyfile has
become obsolete.
To avoid this warning please remove this line from your configuration
file or upgrade it using "doxygen -u"
warning: Tag `HTML_ALIGN_MEMBERS' at line 910 of file Doxyfile has
become obsolete.
To avoid this warning please remove this line from your configuration
file or upgrade it using "doxygen -u"
warning: Tag `USE_INLINE_TREES' at line 1097 of file Doxyfile has
become obsolete.
To avoid this warning please remove this line from your configuration
file or upgrade it using "doxygen -u"
[ 32%] Built target doc_xml
[ 36%] Generating ftdi1_doc.i
[ 40%] Swig source
[ 44%] Building C object bindings/CMakeFiles/_ftdi1.dir/ftdi1PYTHON_wrap.c.o
/home/mcuee/Desktop/build/libftdi/libftdi/build/bindings/ftdi1PYTHON_wrap.c:
In function ‘init_ftdi1’:
/home/mcuee/Desktop/build/libftdi/libftdi/build/bindings/ftdi1PYTHON_wrap.c:12789:21:
warning: variable ‘md’ set but not used [-Wunused-but-set-variable]
Linking C shared module _ftdi1.so
[ 44%] Built target _ftdi1
[ 48%] Building C object ftdi_eeprom/CMakeFiles/ftdi_eeprom.dir/main.c.o
Linking C executable ftdi_eeprom
[ 48%] Built target ftdi_eeprom
[ 52%] Building C object examples/CMakeFiles/baud_test.dir/baud_test.c.o
Linking C executable baud_test
[ 52%] Built target baud_test
[ 56%] Building C object examples/CMakeFiles/bitbang.dir/bitbang.c.o
Linking C executable bitbang
[ 56%] Built target bitbang
[ 60%] Building C object examples/CMakeFiles/bitbang2.dir/bitbang2.c.o
Linking C executable bitbang2
[ 60%] Built target bitbang2
[ 64%] Building C object examples/CMakeFiles/bitbang_cbus.dir/bitbang_cbus.c.o
/home/mcuee/Desktop/build/libftdi/libftdi/examples/bitbang_cbus.c: In
function ‘main’:
/home/mcuee/Desktop/build/libftdi/libftdi/examples/bitbang_cbus.c:63:14:
warning: ignoring return value of ‘fgets’, declared with attribute
warn_unused_result [-Wunused-result]
Linking C executable bitbang_cbus
[ 64%] Built target bitbang_cbus
[ 68%] Building C object
examples/CMakeFiles/bitbang_ft2232.dir/bitbang_ft2232.c.o
Linking C executable bitbang_ft2232
[ 68%] Built target bitbang_ft2232
[ 72%] Building C object examples/CMakeFiles/eeprom.dir/eeprom.c.o
Linking C executable eeprom
[ 72%] Built target eeprom
[ 76%] Building C object examples/CMakeFiles/find_all.dir/find_all.c.o
Linking C executable find_all
[ 76%] Built target find_all
[ 80%] Building CXX object examples/CMakeFiles/find_all_pp.dir/find_all_pp.cpp.o
Linking CXX executable find_all_pp
[ 80%] Built target find_all_pp
[ 84%] Building C object examples/CMakeFiles/serial_test.dir/serial_test.c.o
Linking C executable serial_test
[ 84%] Built target serial_test
[ 88%] Building C object examples/CMakeFiles/simple.dir/simple.c.o
Linking C executable simple
[ 88%] Built target simple
[ 92%] Building C object examples/CMakeFiles/stream_test.dir/stream_test.c.o
Linking C executable stream_test
[ 92%] Built target stream_test
[ 96%] Building CXX object test/CMakeFiles/test_libftdi1.dir/basic.cpp.o
[100%] Building CXX object test/CMakeFiles/test_libftdi1.dir/baudrate.cpp.o
Linking CXX executable test_libftdi1
[100%] Built target test_libftdi1


2) Under Mac OS X, it failed to build (using Homebrew and Apple
XCode Compiler). I am not so sure where the problem is.

[ 40%] Swig source
Scanning dependencies of target _ftdi1
[ 44%] Building C object bindings/CMakeFiles/_ftdi1.dir/ftdi1PYTHON_wrap.c.o
/Users/xiaofanc/work/libftdi/libftdi/build/bindings/ftdi1PYTHON_wrap.c:2366:23:
warning:
      explicitly assigning a variable of type 'int' to itself [-Wself-assign]
                  res = SWIG_AddCast(res);
                  ~~~ ^              ~~~
/Users/xiaofanc/work/libftdi/libftdi/build/bindings/ftdi1PYTHON_wrap.c:2369:23:
warning:
      explicitly assigning a variable of type 'int' to itself [-Wself-assign]
                  res = SWIG_AddCast(res);
                  ~~~ ^              ~~~
2 warnings generated.
Linking C shared module _ftdi1.so
Undefined symbols for architecture x86_64:
  "_convertString", referenced from:
      __wrap_read_data in ftdi1PYTHON_wrap.c.o
      __wrap_get_eeprom_buf in ftdi1PYTHON_wrap.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bindings/_ftdi1.so] Error 1
make[1]: *** [bindings/CMakeFiles/_ftdi1.dir/all] Error 2
make: *** [all] Error 2


-- 
Xiaofan

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread