Author Topic: VS2017 Slick-C deprecation  (Read 2830 times)

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
VS2017 Slick-C deprecation
« on: August 06, 2017, 04:28:00 PM »
I have a bunch of macros that I don't have time to upgrade right now. They won't load because of deprecation warnings, mainly the use of the boolean type instead of the new bool.  Is there a way to convince the compiler to look the other way, at least until 2017 is out. After all, deprecation is only a precursor to actually yanking the support.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: VS2017 Slick-C deprecation
« Reply #1 on: August 07, 2017, 02:07:33 PM »
Use:
#pragma option(strict,on)

Instead of:
#pragma option(pedantic,on)

You can also disable deprecation using:
#pragma option(deprecation,off)

As it says in the docs, pedantic warnings can change across versions, so if you use it, you are subject to fixing your code potentially in each release.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: VS2017 Slick-C deprecation
« Reply #2 on: August 07, 2017, 05:01:00 PM »
Maybe, Slick could do

#pragma option(pedantic, Vxx)
To make Slick enable all existing syntax and deprecation as of Vxx.


jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: VS2017 Slick-C deprecation
« Reply #3 on: August 07, 2017, 05:44:17 PM »
With:
#pragma option(pedantic,on)
#pragma option(deprecation,off)


Slick still complains The 'boolean' keyword is deprecated, use 'bool'.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: VS2017 Slick-C deprecation
« Reply #4 on: August 07, 2017, 05:50:46 PM »
It's better to use #pragma option(strict,on)

While the message does use the word "deprecated", the "bool" keyword change is more of a language change than a traditional deprecation, so that is why the check is intentionally not disabled by the deprecation pragma.

Version-specific pedantic would be nice, but that would be a large matrix of options to create for only a small benefit.  Simpler solution is to use "strict" for macros you want to be forward compatible.  Use pedantic only when developing macros to get the best error checking.