Menu

doesn't compile in c++11 without warnings

2016-10-07
2016-10-07
  • Arnaud Richard

    Arnaud Richard - 2016-10-07

    Hi,
    I thought I found my graal when I landed on your iof library.
    However the compilation generated tons of errors.
    They may be harmless warnings but that's the way the project is compiled. Almost all warning are enabled and none is allowed.
    I was wondering, is iof library still active? Is there any update?
    I have now changed my code to fix the warnings. How could I share it?

    I'm compiling with gcc 4.8.3 in c++11 mode.

    Here is the first error that show you the compile line command:
    /sw/arm/ds-5/5.24/sw/gcc/bin//arm-linux-gnueabihf-c++ -Wall -Wextra -Wmaybe-uninitialized -Werror -Wno-error=unused-function -Wno-error=unused-variable -O0 -g -fPIC -I../../../ioflib-0_8_0a/include -std=c++11 -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wno-unused -MMD -MP -MF "FpgaAsg.o.d" -MT "FpgaAsg.o" -I../../zlog/Release -c -o FpgaAsg.o /prj/mmyappli/users/richarda/RedPitaya/DS-5/Workspace/NfcPitaya/src/FpgaAsg.cpp
    In file included from ../../../ioflib-0_8_0a/include/iof/fmtr_out.hpp:15:0,
    from ../../../ioflib-0_8_0a/include/iof/fmtr.hpp:18,
    from ../../../ioflib-0_8_0a/include/iof/prints.hpp:17,
    from ../../../ioflib-0_8_0a/include/iof/cerrf.hpp:16,
    from ../../../ioflib-0_8_0a/include/iof/output.hpp:15,
    from ../../../ioflib-0_8_0a/include/iof/io.hpp:16,
    from /prj/mmyappli/users/richarda/RedPitaya/DS-5/Workspace/NfcPitaya/src/FpgaAsg.cpp:32:
    ../../../ioflib-0_8_0a/include/iof/except.hpp: In constructor ‘iof::iof_private::failure::failure(const char*, iof::iof_private::failure::err_type)’:
    ../../../ioflib-0_8_0a/include/iof/except.hpp:42:9: error: declaration of ‘problem’ shadows a member of 'this' [-Werror=shadow]
    : problem(problem), errType(type) {}


    Here are the gcc details:
    /sw/arm/ds-5/5.24/sw/gcc/bin//arm-linux-gnueabihf-c++ -v
    Using built-in specs.
    COLLECT_GCC=/sw/arm/ds-5/5.24/sw/gcc/bin//arm-linux-gnueabihf-c++
    COLLECT_LTO_WRAPPER=/sw/arm/ds-5/5.24/sw/gcc/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/lto-wrapper
    Target: arm-linux-gnueabihf
    Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.8-2014.04/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --enable-multilib --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb --with-float=hard
    Thread model: posix
    gcc version 4.8.3 20140401 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04)


     
  • schoenborno

    schoenborno - 2016-10-07

    Hello Richard, I don't have a linux distro setup, so I can't try. What flavor of linux are you building on? The project is still alive in that if there are issues, I will attempt to support, but I have been focused on Python for the last couple years so I have not tried with gcc or even Windows since then.

    In any case, looks like you were able to make some progress? Have you tried turning off the problem warnings by putting pragmas in the iof header files that trigger them? For example,

    # some iof header file, near top:
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wshadow"
    
    ...iof code...
    
    # bottom of file: 
    #pragma GCC diagnostic pop
    

    This would prevent those warnings from being emitted so the Werrors would not kick in.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.