Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing the g++ warning "-Wliteral-suffix" for specific include headers

I am working on a project, in which I use the new c++11 standard. Because of that, few include-headers from a library now generate the warning -Wliteral-suffix, which I would supress for that includes.

I have found an easy solution for that using pragmas, but it doesn't work for me

How to suppress GCC warnings from library headers?

This is my current code:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wliteral-suffix"

#include <pylon/PylonBase.h>
#include <pylon/InstantCamera.h>
#include <pylon/TlFactory.h>

#pragma GCC diagnostic pop

All current Warnings generated by the library look like this:

/opt/pylon3/genicam/library/CPP/include/Base/GCException.h:272:105: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]

I am using gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

like image 234
pointhi Avatar asked Jun 29 '14 08:06

pointhi


1 Answers

I think you must use just the opposite: -Wno-literal-suffix. I'm also getting more problems with this version than with the old 4.7.2 (finest).

like image 52
Mel Viso Martinez Avatar answered Oct 02 '22 09:10

Mel Viso Martinez