Getting a warning message as below which I am trying to get rid off
warning: initialization discards `const' from pointer target type
The code needs to stay as it is so in VS used Suppress Specific Warning but I was wondering if there is some way to do the same in gcc as well.
Using quite an older version of GCC compiler 3.4 all the other posts I have come across talk about higher versions. Some helpful posts-
How to supress specific warnings in g++
http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Warning-Options.html
Tried using-
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
//< code that generates warning >
#pragma GCC diagnostic pop
But then the warnings increase-
: warning: ignoring pragma: push
: warning: ignoring pragma: "-Wignored-qualifiers
: warning: initialization discards `const' from pointer target type
: warning: initialization discards `const' from pointer target type
: warning: ignoring pragma: pop