FW: deprecated functions

View: New views
5 Messages — Rating Filter:   Alert me  

FW: deprecated functions

by John Bowler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm resending this message without the patch as this exceeds the default
size limit for the mailing list.

>On Sun, 1 Nov 2009, glennrp@... wrote:
>>
>>     page 224, "The Dark Side", warns people off of both png_ptr
>>     and info_ptr (a.k.a. png_info).  They probably don't notice
>>     it, though, because it is in a box.

My recent experiments suggest that no one reads this.  Bob suggested:

From: Bob Friesenhahn [mailto:bfriesen@...]
>Maybe you should start using GCC's
>
>   __attribute__ ((deprecated))
>
>so that use of deprecated (or exposed private) members and functions
>become immediately apparent to any GCC user?

I agree.  I've attached a patch to 1.4.0beta92 that does, indeed, produce
the expected stream of warnings on a number of projects (but not all.)  Can
you apply this to the beta Glenn?

If there is another non-security release of 1.2 that should definitely also
have the relevant functions/members marked as deprecated.

The patch adds appropriate attributes to structure members, functions (GCC
noreturn and 'malloc') and moves a few things from png.h that are internal
to the library.

I've now got a system that builds against an unpatched 1.4.0beta92 (i.e. I
have patches for every package on my system), I'm running another build to
double check the above patch - just to see I didn't move anything from png.h
that is required by something.

John Bowler <jbowler@...>



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Re: FW: deprecated functions

by Matthias B. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 5 Nov 2009 19:09:13 -0800
"John Bowler" <jbowler@...> wrote:

> I'm resending this message without the patch as this exceeds the
> default size limit for the mailing list.

I would have approved your message. The lists are actively being
moderated (although not on a daily basis). I always check whether the
poster has resent the message, though, and discard it in that case. So
your original message will not show up now that you've posted this.

MSB

--
Support bacteria - they're the only culture some people have.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Re: FW: deprecated functions

by Glenn Randers-Pehrson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 5, 2009 at 10:09 PM, John Bowler <jbowler@...> wrote:

> I agree.  I've attached a patch to 1.4.0beta92 that does, indeed, produce
> the expected stream of warnings on a number of projects (but not all.)  Can
> you apply this to the beta Glenn?

OK, I am convinced.  Your patch exposed three direct accesses to
read_info_ptr->bit_depth and read_info_ptr->color_type in
pngtest.c!

Glenn

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Re: FW: deprecated functions

by Glenn Randers-Pehrson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think our "internally exported PRIVATE" functions should be marked
PNG_DEPRECATED.
It would have saved me some time today wondering why the loader could not find
png_write_text().  Apparently the compiler does not always  notice the problem.

Glenn

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Re: FW: deprecated functions

by John Bowler-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Glenn Randers-Pehrson [mailto:glennrp@...]
>I think our "internally exported PRIVATE" functions should be marked
>PNG_DEPRECATED. It would have saved me some time today wondering why
>the loader could not find png_write_text().  Apparently the compiler
>does not always  notice the problem.

"png_write_text"?  Do you mean png_write_tEXt?  This is only an issue in 1.2
isn't it, and it has always been there?

So far as I can see marking it as PNG_DEPRECATED in 1.2 is just a partial
back-port of the correct fix in 1.4 (moving these functions to pngpriv.h).
There can't be that many programs that call png_write_tEXt therefore I don't
see much point in making such a change to the 1.2 header files but if you
want to do it then it should not be PNG_DEPRECATED.

Instead conditionally (not a libpng build) add:

__attribute__(__warning__("This function is not supported."))

See:

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attribut
es

for the full explanation of when __warning__ has an effect.  "deprecated"
means the feature will be removed *in a future version*, whereas calling any
of the internal functions was never approved.

John Bowler <jbowler@...>



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement