GCC build warning: png.h:2647:0: warning: "png_get_int_32" redefined [enabled by default] (other definition is in mozpngconf.h)

RESOLVED FIXED in mozilla13

Status

()

Core
ImageLib
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: Glenn Randers-Pehrson)

Tracking

(Blocks: 1 bug)

Trunk
mozilla13
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Noticed this build warning get spammed a few times during my build today:
{
../../../dist/include/png.h:2647:0: warning: "png_get_int_32" redefined [enabled by default]
../../../dist/include/mozpngconf.h:237:0: note: this is the location of the previous definition
}

It looks like these lines were added (or at least last touched) in bug 648690, a few days ago.
(Reporter)

Comment 1

6 years ago
The two definitions are here:
http://hg.mozilla.org/mozilla-central/annotate/78e56fd22f2a/media/libpng/mozpngconf.h#l237
http://hg.mozilla.org/mozilla-central/annotate/78e56fd22f2a/media/libpng/png.h#l2647

> It looks like these lines were added (or at least last touched) in bug 648690, a few days ago.

slight correction: only the definition in mozpngconf.h was added in that bug.  The other one (png.h) was from bug 624133. (an earlier libpng upgrade)
(Assignee)

Comment 2

6 years ago
It should not have been added.  The macros in mospngconf.h rename exported symbols.
If PNG_USE_READ_MACROS is set, then png_get_int_32() is an internal macro that doesn't
need to be renamed.  Solution is just to remove the new redefinition from mozpngconf.h.
(Assignee)

Comment 3

6 years ago
The png_get_int_32() macro is only used when processing the PNG oFFs and pCAL chunks, which we ignore, so this isn't an urgent problem.  I'll see about revising libpng-1.5.10 to not define the macro when neither of those chunks is being recognized.
(Assignee)

Comment 4

6 years ago
I am seeing several similar warnings about redefinition of png_benign_warning() and others.  I'm working on a patch to fix all of them.  Taking the bug.
Assignee: nobody → glennrp+bmo
Status: NEW → ASSIGNED
(Assignee)

Comment 5

6 years ago
Created attachment 603603 [details] [diff] [review]
v00: Eliminate warnings about redefined macros in mozpngconf.h
(Assignee)

Comment 6

6 years ago
Need a tryserver run with the v00 patch.
(Assignee)

Updated

6 years ago
OS: Linux → All
Hardware: x86_64 → All
(Assignee)

Updated

6 years ago
Attachment #603603 - Attachment description: Eliminate warnings about redefined macros in mozpngconf.h → v00: Eliminate warnings about redefined macros in mozpngconf.h

Comment 7

6 years ago
How it compiles after the patch?
Whiteboard: [autoland-try]

Updated

6 years ago
Whiteboard: [autoland-try] → [autoland-in-queue]

Comment 8

6 years ago
Autoland Patchset:
	Patches: 603603
	Branch: mozilla-central => try
Insufficient permissions to push to try.

Updated

6 years ago
Whiteboard: [autoland-in-queue]
In file included from ../../../media/libpng/pngmem.c:20:0:
../../../media/libpng/pngpriv.h:225:0: warning: "png_warning_parameter" redefined
../../../media/libpng/mozpngconf.h:605:0: note: this is the location of the previous definition
../../../media/libpng/pngpriv.h:226:0: warning: "png_warning_parameter_unsigned" redefined
../../../media/libpng/mozpngconf.h:607:0: note: this is the location of the previous definition
../../../media/libpng/pngpriv.h:227:0: warning: "png_warning_parameter_signed" redefined
../../../media/libpng/mozpngconf.h:606:0: note: this is the location of the previous definition
../../../media/libpng/pngpriv.h:228:0: warning: "png_formatted_warning" redefined
../../../media/libpng/mozpngconf.h:543:0: note: this is the location of the previous definition
../../../media/libpng/pngpriv.h:234:0: warning: "png_fixed_error" redefined
../../../media/libpng/mozpngconf.h:540:0: note: this is the location of the previous definition
(Assignee)

Comment 11

6 years ago
Created attachment 603949 [details] [diff] [review]
v01-733598.diff

Fix additional redefine warnings in mozpngconf.h
Attachment #603603 - Attachment is obsolete: true
libpng is warning-free with the v1 patch.

Comment 13

6 years ago
Try run for b097a2f3cae4 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=b097a2f3cae4
Results (out of 32 total builds):
    exception: 1
    success: 28
    warnings: 3
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/ryanvm@gmail.com-b097a2f3cae4
Attachment #603949 - Flags: review?(joe)
Attachment #603949 - Flags: review?(joe) → review+
https://hg.mozilla.org/mozilla-central/rev/19b7ccace430
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.