Coder Social home page Coder Social logo

Comments (2)

uwewoessner avatar uwewoessner commented on May 27, 2024

Werror is disabled in many places already. It is good practice to take warnings seriously but if Werror creates more trouble than it solves we should disable it by default.Uwe

--Dr.-Ing. Uwe WoessnerHigh Performance Computing Center Stuttgart
mobile: +49-173-7028729office: +49-711-6856-5790http://www.hlrs.de/people/woessner/

-------- Ursprüngliche Nachricht --------
Von: Stefan Zellmann [email protected]
Datum: 07.02.2016 14:22 (GMT+01:00)
An: hlrs-vis/covise [email protected]
Betreff: [covise] Warnings from 3rdparty headers and -Werror (#20)

I keep getting warnings like the following on Ubuntu 15.04 and 15.10:

In file included from /usr/lib/openmpi/include/mpi.h:253:0,
                 from /home/zellmans/covise/src/OpenCOVER/cover/coVRMSController.h:25,
                 from /home/zellmans/covise/src/OpenCOVER/cover/coVRPluginList.cpp:17:
/usr/lib/openmpi/include/mpi_portable_platform.h:374:34: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
              _STRINGIFY(__GNUC__)"."_STRINGIFY(__GNUC_MINOR__)"."_STRINGIFY(__GNUC_PATCHLEVEL__)
                                  ^
/usr/lib/openmpi/include/mpi_portable_platform.h:374:63: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
              _STRINGIFY(__GNUC__)"."_STRINGIFY(__GNUC_MINOR__)"."_STRINGIFY(__GNUC_PATCHLEVEL__)

I think this has to do with C++11 raw string literals that can optionally be pre- and suffixed with some token for disambiguation.

Unfortunately, with -Werror activated, I need to care about this. It is only clear on second sight that errors like these are actually warnings - I mean, gcc reports *error: invalid suffix on literal", and only appends the warning code as the only means for clarification.

I personally think that treating warnings as errors is only viable for compilation units that don't include 3rdparty headers and would argue that we generally deactivate this GCC option.


Reply to this email directly or view it on GitHub:
#20

from covise.

aumuell avatar aumuell commented on May 27, 2024

I think it's good if code compiles without warnings: this will make you notice the warnings that are introduced by new changes, and occasionally these warnings point to real problems which might be overlooked in the first place.

The policy of defaulting to -Werror in general helps to keep warnings down. Especially as with recent GCCs it's very easy to disable the treatment of warnings as errors selectively, we should stick to this policy.

In this special case adding -Wno-error=literal-suffix to cmake/Using/UseMPI.cmake should help.

from covise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.