bugpng++, a C++ wrapper for libpng - Bugs: bug #45426, PNG++ produces warnings when...

 
 

bug #45426: PNG++ produces warnings when compiling under MSVC++ 2015 for AMD64 (with patch!)

Submitted by:  None
Submitted on:  Sat 27 Jun 2015 05:56:33 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 25 Oct 2015 06:37:21 PM UTC, comment #5:

The size_t<=>uint_32 use should now also be OK.

Alexander Shulgin <alexshulgin>
Project Administrator
Sun 25 Oct 2015 05:24:14 PM UTC, comment #4:

Well, this has taken me a while to finally take a look.

I could conclude that strerror_s() is not available with current versions of glibc and even though this function is indeed in the C11 standard, its implementation is optional, not mandatory.

In the end, we use strerror_s() if available, otherwise we use strerror_r().

Alexander Shulgin <alexshulgin>
Project Administrator
Tue 30 Jun 2015 07:57:19 PM UTC, comment #3:

http://en.cppreference.com/w/c/string/byte/strerror
Seems strerror_s is standard since C11

Anonymous
Mon 29 Jun 2015 05:49:50 AM UTC, comment #2:

Thank you for this patch!

I will review and merge the changes, if everything is OK. For one, I can see that on GNU or POSIX system you should use strerror_r instead (strerror_s being a MS extension?)

Alexander Shulgin <alexshulgin>
Project Administrator
Sat 27 Jun 2015 06:42:02 PM UTC, comment #1:

BTW, here is the compiler output with warnings:

Anonymous
Sat 27 Jun 2015 05:56:33 PM UTC, original submission:

Most of the warnings were about size_t (which is unsigned __int64 under AMD64) being assigned to uint_32.
One more warning warns that strerror() is not thread safe.

These warning have been fixed by me, so png++ does not produce any warnings anymore. See attached patch.

Most of the size_t variables were replaced with uint_32 (and byte in one case) because PNG does not support image dimensions of 64 bit anyway. Moreover, it is always 32 bit unsigned integer. The bit depth is 8 bit, so that was changed as well.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #34331:  pngpp_svn-vs2015_warnings_fix.patch added by None (12KiB - application/octet-stream - The fix for warnings.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by alexshulgin (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 25 Oct 2015 06:37:21 PM UTCalexshulginStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sat 27 Jun 2015 05:56:33 PM UTCNoneAttached File-=>Added pngpp_svn-vs2015_warnings_fix.patch, #34331

    Back to the top


    Powered by Savane 3.1-cleanup1