Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings when building against libpng-1.4/1.5 #139

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

warnings when building against libpng-1.4/1.5 #139

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: unspecified
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2018-10-13 12:20:06 +0000, Ozkan Sezer wrote:

Created attachment 3371
IMG_png warnings patch

When building against libpng-1.4/1.5 with --disable-png-shared, warnings
are emitted:
I20/IMG_png.c:145: warning: assignment from incompatible pointer type
I20/IMG_png.c:146: warning: assignment from incompatible pointer type
I20/IMG_png.c:147: warning: assignment from incompatible pointer type
I20/IMG_png.c:148: warning: assignment from incompatible pointer type

Some libpng functions take non-const args in 1.2..1.5, but take const
args in 1.6. To make it worse, some funcs, e.g. png_get_PLTE(), take
const args in 1.4..1.5 but take non-const args in 1.6+, like:
1.4/1.5: (png_const_structp , png_const_infop, png_colorp *, int *)
1.6/1.7: (png_const_structrp, png_inforp , png_colorp *, int *)

I came up with the following quick'n'dirty patch, which adds noconst15
and noconst16 to affected function pointer typedefs:
noconst15: version < 1.6 doesn't have const, >= 1.6 adds it
noconst16: version < 1.6 does have const, >= 1.6 removes it

Should I apply, or should we live with the warnings (which would break
builds if one uses -Werror) ?

On 2018-10-23 20:01:18 +0000, Ozkan Sezer wrote:

Went ahead and applied this:
http://hg.libsdl.org/SDL_image/rev/89225c8816d6
http://hg.libsdl.org/SDL_image/rev/fa3c53a205a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant