Author Topic: Deprecated Slick-C preprocessor symbols  (Read 2346 times)

jnairb

  • Senior Community Member
  • Posts: 245
  • Hero Points: 11
Deprecated Slick-C preprocessor symbols
« on: March 25, 2015, 02:16:51 PM »
SlickEdit 19.0.2 (RC2 & 3) give an error when loading a macro containing "#if __UNIX__", saying --UNIX-- is deprecated. I found the _isUnix() function to use instead, but it's not documented in the help and __UNIX__ is still documented in the help. (Also noticed that __NT__ and __PCDOS__ give the same error.)

Was it intentional that macros using those will break on upgrading to 19.0.2? To me, deprecated means don't use it, but it currently still works. That doesn't appear to be the case. And is _isUnix() a supported replacement?

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Deprecated Slick-C preprocessor symbols
« Reply #1 on: March 25, 2015, 05:49:03 PM »
If you are using #pragma option(pedantic), then you are telling Slick-C to flag any deprecation as an error.  Slick-C doesn't have warnings.

The docs should be updated.  I'll make a note of that.

And, yes, _isUnix() is the correct replacement for #if __UNIX__.  _isWindows() is the replacement for #if __WINDOWS__, and _isMac() is the replacement for #if __MACOSX__

We do our best to keep macros backward compatible, but #pragma option(pedantic) is a special case (and documented as such).  If you use it, you are subject to future language changes, symbol deprecation, and higher levels of error checking to cause your existing macro to no longer compile.  We use pedantic in all the code we ship, but recommend #pragma option(strict) for users.

jnairb

  • Senior Community Member
  • Posts: 245
  • Hero Points: 11
Re: Deprecated Slick-C preprocessor symbols
« Reply #2 on: March 25, 2015, 06:07:53 PM »
I have #pragma option(strict2,on)... not pedantic, and I get the error.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Deprecated Slick-C preprocessor symbols
« Reply #3 on: March 25, 2015, 09:06:36 PM »
You are correct, this is a new bug in 19.0.2.  "strict2" should not flag anything as deprecated.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: Deprecated Slick-C preprocessor symbols
« Reply #4 on: March 26, 2015, 08:44:28 PM »
Dennis has fixed this for 19.0.2 RC 4 which we expect to be available tomorrow.