Bug 79316 - ignoring return value of ‘int symlink(const char*, const char*)’
Summary: ignoring return value of ‘int symlink(const char*, const char*)’
Status: RESOLVED FIXED
Alias: None
Product: SyncEvolution
Classification: Unclassified
Component: SyncEvolution (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Patrick Ohly
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-27 14:30 UTC by Emiliano Heyns
Modified: 2014-07-23 09:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Emiliano Heyns 2014-05-27 14:30:24 UTC
When compiling SyncEvolution with the recommended developer configure settings, I get the following error:

src/syncevo/Cmdline.cpp: In member function ‘void SyncEvo::CmdlineTest::testPrintFileTemplatesConfig()’:
src/syncevo/Cmdline.cpp:3126:82: error: ignoring return value of ‘int symlink(const char*, const char*)’, declared with attribute warn_unused_result [-Werror=unused-result]
         symlink("../templates", (m_testDir + "/syncevolution-templates").c_str());
                                                                                  ^

(master branch, checkout from this morning, refreshed with git pull)
Comment 1 Patrick Ohly 2014-05-27 14:55:58 UTC
On which platform (Linux distro, libc, compiler) is that?
Comment 2 Emiliano Heyns 2014-05-27 15:03:55 UTC
Platform: Ubuntu Trusty

Configured using 

   configure --with-synthesis-src=../libsynthesis \
             --enable-warnings=fatal \
             --enable-unit-tests \
             --enable-libcurl \
             --disable-shared \
             --enable-developer-mode

with libsynthesis a git clone from freedesktop;

$ dpkg -l | grep libc-dev
ii  libc-dev-bin                                                2.19-0ubuntu6                            i386         Embedded GNU C Library: Development binaries
ii  linux-libc-dev:i386                                         3.13.0-27.50                             i386         Linux Kernel Headers for development

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
Comment 3 Emiliano Heyns 2014-05-27 18:00:25 UTC
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

$ clang -v
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: i386-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/i486-linux-gnu/4.0.4
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.4
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.4.7
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.6.4
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.7
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.7.3
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.8.2
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.9.0
Found candidate GCC installation: /usr/lib/gcc/i486-linux-gnu/4.0.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.0
Selected GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.8

Compiling with clang instead of gcc yields:

/home/emile/SE/syncevolution/../libsynthesis/src/syncml_tk/src/sml/xlt/all/xltdecxml.c:865:17: error: comparison of constant 255 with expression of type 'SmlPcdataExtension_t' is always false
      [-Werror,-Wtautological-constant-out-of-range-compare]
        if (ext == 255) {
Comment 4 Patrick Ohly 2014-05-27 18:38:59 UTC
It's not unusual that different compilers yield different warnings. Trusty is a platform where I currently compile with fatal warnings disabled (configure without the --enable-warnings=fatal). I suggest you do the same, or you prepare patches fixing the warnings.
Comment 5 Emiliano Heyns 2014-05-28 08:13:58 UTC
Gotcha.
Comment 6 Patrick Ohly 2014-07-23 09:14:52 UTC
Fixed in SyncEvolution master branch, together with some other issues that I also ran into when adding compilation with tests enabled and strict warnings on Trusty.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.