How to turn off deprecated warnings

Have a question about our Software Developer Kit? Ask them here.

Re: How to turn off deprecated warnings

Postby softwarefailure » Thu Apr 23, 2015 6:19 pm

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.
softwarefailure
 
Posts: 61
Joined: Fri Feb 14, 2014 11:29 pm

Re: How to turn off deprecated warnings

Postby xenic » Thu Apr 23, 2015 6:35 pm

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
xenic
 
Posts: 1001
Joined: Sun Jun 19, 2011 1:06 am

Re: How to turn off deprecated warnings

Postby Thomas Frieden » Fri Apr 24, 2015 2:16 pm

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
Thomas Frieden
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 147
Joined: Fri Dec 10, 2010 4:21 pm

Re: How to turn off deprecated warnings

Postby gazelle » Fri Apr 24, 2015 4:04 pm

Maybe he's living up to his name? scnr, ;)
User avatar
gazelle
 
Posts: 101
Joined: Sun Mar 04, 2012 1:49 pm
Location: Frohnleiten, Austria

Re: How to turn off deprecated warnings

Postby xenic » Fri Apr 24, 2015 5:29 pm

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


Maybe his software does too :-)
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1001
Joined: Sun Jun 19, 2011 1:06 am

Re: How to turn off deprecated warnings

Postby softwarefailure » Sat Apr 25, 2015 12:40 pm

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.
softwarefailure
 
Posts: 61
Joined: Fri Feb 14, 2014 11:29 pm

Re: How to turn off deprecated warnings

Postby Thomas Frieden » Sat Apr 25, 2015 6:30 pm

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
Thomas Frieden
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 147
Joined: Fri Dec 10, 2010 4:21 pm

Re: How to turn off deprecated warnings

Postby colinw » Sun Apr 26, 2015 2:22 am

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
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 158
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: How to turn off deprecated warnings

Postby jaokim » Sun Apr 26, 2015 9:09 pm

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
User avatar
jaokim
Beta Tester
Beta Tester
 
Posts: 89
Joined: Sat Jun 18, 2011 1:41 am

Re: How to turn off deprecated warnings

Postby AmiDARK » Sat Jun 20, 2015 2:29 pm

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...
AmiDARK
 
Posts: 27
Joined: Thu Oct 20, 2011 10:23 am

PreviousNext

Return to SDK Support

Who is online

Users browsing this forum: No registered users and 1 guest