Author Topic: Suppress some warnings (allow code)  (Read 4011 times)

Offline markpotts

  • Multiple posting newcomer
  • *
  • Posts: 15
Suppress some warnings (allow code)
« on: December 30, 2013, 11:11:08 pm »
I am starting to use C::B for a cross compilation project (Windows -> Linux) and I am getting warnings for various coding practices I use, e.g.

    char *msg = "A message";
or
    msg = "Another message";

The typically warnings say something like:

  deprecated conversion from string constant to 'char*' [-Wwrite-strings]

If possible I would like to disable the warnings I consider acceptable. I assumed the parameter in brackets was some sort of compiler flag I could set. I tried adding (and selecting) the flag in Settings->Compiler but the warnings persist. Any advice would be welcome.

Thanks,
Mark

 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Suppress some warnings (allow code)
« Reply #1 on: December 30, 2013, 11:29:40 pm »
Read the manual of your compiler, there you'll find how to add warning suppressions!
Generally this is a topic that is outside the scope of the forum!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline markpotts

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Suppress some warnings (allow code)
« Reply #2 on: December 31, 2013, 12:31:27 am »
Thanks for the feedback. I checked the GCC compiler manual and found that I needed to specify "-Wno-write-strings". When I used this format the warnings were suppressed.