How to turn off deprecated warnings

Have a question about our Software Developer Kit? Ask them here.
softwarefailure
Posts: 103
Joined: Fri Feb 14, 2014 10:29 pm

Re: How to turn off deprecated warnings

Post by softwarefailure »

Thomas Frieden wrote: is to give a hint
giving a hint != spamming developers with heaps of redundant, irrelevant, completely harmless warnings

It's impossible to do serious development when you get dozens of deprecated warnings because they conceal the really important warnings that you need to see as a developer. It's utter nonsense, really. You cannot expect developers to immediately rewrite large chunks of code and risk to introduce new issues and bugs just because someone got the idea to deprecate things. There MUST be an elegant way to turn this off, everything else is like a dictatorship.

xenic
Posts: 1165
Joined: Sun Jun 19, 2011 12:06 am

Re: How to turn off deprecated warnings

Post by xenic »

softwarefailure wrote:
Thomas Frieden wrote: is to give a hint
giving a hint != spamming developers with heaps of redundant, irrelevant, completely harmless warnings
No. The deprecated warnings serve as a reminder to programmers writing NEW OS4 programs (based on experience with OS3 programming) that they should be using OS4 functions instead of the old OS3 functions in most cases. We've told you how to disable the warnings so there should be no problem.

Personally, I wouldn't have realized I was using outdated functions when I started writing OS4 programs if it weren't for the DEPRECATED warnings. I think they are helpful when writing new code and easily disabled when working on multi-platform Amiga code.
AmigaOne X1000 with 2GB memory - OS4.1 FE

User avatar
Thomas Frieden
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 147
Joined: Fri Dec 10, 2010 3:21 pm

Re: How to turn off deprecated warnings

Post by Thomas Frieden »

softwarefailure wrote:
Thomas Frieden wrote: is to give a hint
giving a hint != spamming developers with heaps of redundant, irrelevant, completely harmless warnings
Irrelevant ? Redundant ?

You are basically accusing us of doing this on purpose just to piss you off ?

There is a reason the compiler warns you about these functions, and if you get "heaps" of theses, then it's time to reconsider your code. There is a reason these functions have been declared deprecated. A lot of those functions have implications that are no longer valid. For example, AllocMem, if you're still using it, I wonder if you're still using MEMF_PUBLIC ? Are you even aware what this means ? Or MEMF_CHIP ? Do you know that this doesn't exist anymore in anything but classics ?

The deprecation messages will help you identify potential problems in your code. They are _FAR_ from harmless. If you have tons of them in your code, then chances are you don't know about the implications.
softwarefailure wrote: It's impossible to do serious development when you get dozens of deprecated warnings because they conceal the really important warnings that you need to see as a developer. It's utter nonsense, really. You cannot expect developers to immediately rewrite large chunks of code and risk to introduce new issues and bugs just because someone got the idea to deprecate things. There MUST be an elegant way to turn this off, everything else is like a dictatorship.
Dictatorship ? Are you serious ? Just add the define that was posted earlier, and you're rid of them. How elegant do you want it to be ?

User avatar
gazelle
Posts: 102
Joined: Sun Mar 04, 2012 12:49 pm
Location: Frohnleiten, Austria

Re: How to turn off deprecated warnings

Post by gazelle »

Maybe he's living up to his name? scnr, ;)

xenic
Posts: 1165
Joined: Sun Jun 19, 2011 12:06 am

Re: How to turn off deprecated warnings

Post by xenic »

gazelle wrote:Maybe he's living up to his name? scnr, ;)
Maybe his software does too :-)
AmigaOne X1000 with 2GB memory - OS4.1 FE

softwarefailure
Posts: 103
Joined: Fri Feb 14, 2014 10:29 pm

Re: How to turn off deprecated warnings

Post by softwarefailure »

Just add the define that was posted earlier, and you're rid of them. How elegant do you want it to be ?
To me, setting -DDEPRECATED= is a hack/workaround and not an elegant solution. An elegant solution is adding a new define that actually does what it says, e.g. -D__NO_DEPRECATED__ to skip deprecated warnings.

User avatar
Thomas Frieden
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 147
Joined: Fri Dec 10, 2010 3:21 pm

Re: How to turn off deprecated warnings

Post by Thomas Frieden »

softwarefailure wrote:
Just add the define that was posted earlier, and you're rid of them. How elegant do you want it to be ?
To me, setting -DDEPRECATED= is a hack/workaround and not an elegant solution. An elegant solution is adding a new define that actually does what it says, e.g. -D__NO_DEPRECATED__ to skip deprecated warnings.
As I said, adding a dedicated macro is out of question. I'll bring up the possibility to automatically switch off the deprecated warnings when using __USE_INLINE__, because I see a sense in that. But again, deprecated functions are deprecated for a reason, and ignoring the warning messages might result in your program misbehaving in later versions of the OS.

User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 181
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: How to turn off deprecated warnings

Post by colinw »

Thomas Frieden wrote: ... But again, deprecated functions are deprecated for a reason, and ignoring the warning messages might result in
your program misbehaving in later versions of the OS.
I consider that using deprecated functions intensionally, simply defines your software as pre-broken in some way,
it therefore won' t be able to adapt to changes required to bring the operating system forward or extend functionality.

There is always a reason why a function is deprecated, whether it be simply because it couldn't host new features because
the old API design ruined any chance of extensibility, or whether the API used parameters or structures that were limited
to 32 bit quantities, or whether said structures had limited sized buffers that couldn't handle full sized string lengths,
or some other reasons.

In any way, the use of these functions PREVENTS software from being able to handle situations where someone may
pass a name that happens to be longer than will fit, or a file may be sized larger than can be returned in 32 bits.

Your software is already broken if these kind of limitations are enforced, it's just a matter of time before someone creates
a filename longer that 107 bytes or stores a 5gig movie file on the disk, before your software will break in unknown ways.

User avatar
jaokim
Beta Tester
Beta Tester
Posts: 90
Joined: Sat Jun 18, 2011 12:41 am

Re: How to turn off deprecated warnings

Post by jaokim »

softwarefailure wrote:
To me, setting -DDEPRECATED= is a hack/workaround and not an elegant solution. An elegant solution is adding a new define that actually does what it says, e.g. -D__NO_DEPRECATED__ to skip deprecated warnings.
Wouldn't "NO DEPRECATED" mean that no deprecated functions should be used, i.e. basically what you have today? A better define would be "USE DEPRECATED FUNCTIONS WITHOUT WARNINGS EVEN IF IT MIGHT BRAKE MY PROGRAM". The elegant solution would be to circumvent the deprecations using methods described here. Or just live with the warnings.
:P

AmiDARK
Posts: 40
Joined: Thu Oct 20, 2011 9:23 am

Re: How to turn off deprecated warnings

Post by AmiDARK »

I understand that some functions must become "deprecated" to allow new and more effective functions to appear...
But maybe that havine the autodocs correctly updated ... should be a +
for example, I get deprecated for CreateMsgPort, DeleteMsgPort but in t the exec.doc (autodocs) it is not mentioned that they are deprecated, nor the function to use instead...
Same problem for CreateIORequest, DeleteIORequest functions from exec...
Sam440EP - AmigaOS 4.1 Final Edition

Post Reply