bugpng++, a C++ wrapper for libpng - Bugs: bug #46312, Compilation fails on MacOS X with...


bug #46312: Compilation fails on MacOS X with g++ 5.2 (MacPorts)

Submitted by:  None
Submitted on:  Wed 28 Oct 2015 03:31:34 PM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

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


Sun 22 Jul 2018 08:43:59 PM UTC, comment #3:

It is not abandoned, though might look like so. :(
Hosting on Savannah instead of popular choices like github is not accidental.

Now to the actual problem. It turns out to be surprisingly hard to get error reporting code work on all platforms and what I used to do is to trust people who come with patch that fixes problem for them on their platform and at the same time doesn't break it for me...

Now what is your platform and which version of png++ are you using?


Alexander Shulgin <alexshulgin>
Project Administrator
Sat 21 Jul 2018 07:31:59 PM UTC, comment #2:

Thanx Adam! Fix is working like a charm. Can someone migrate this old repo to GitHub? It looks abandoned.

Sun 08 May 2016 07:36:43 AM UTC, comment #1:

Just encountered this issue as well. Unfortunately the posted .hpp file introduces a subtle new problem. Under the default Linux/glibc config, the return value of strerror_r() is required to be used, and this change disregards it, so you'll get invalid data instead of error messages under Linux if you use this proposed fix.

Instead, if you change the conditions so that _GLIBC_ is required before using the GNU version, then it will only use that function when linked with glibc. When compiling with Clang's libc++, _GLIBC_ won't be defined and you'll get the version with the ignored return value.

I have used Travis CI to test this change with both Clang and GCC under both Linux and OSX, and it compiles successfully.

Adam Nielsen <malvineous>
Wed 28 Oct 2015 03:31:34 PM UTC, original submission:

Reason: strerror_r() is used with a char* return type.

I suggest using the variant that ignores the return value
and a really large buffer size. The attached code works.



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

Attach Files:

Attached Files
file #35325:  error.hpp added by None (3KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-28 None Attached File- => Added error.hpp, #35325

    Back to the top

    Powered by Savane 3.3