Closed Bug 1141178 Opened 5 years ago Closed 5 years ago

nsPrintOptionsGTK.h:16:3: error: struct 'PrintData' was previously declared as a class [-Werror,-Wmismatched-tags]

Categories

(Core :: Widget: Gtk, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 1082579

People

(Reporter: keeler, Assigned: nsm)

References

Details

Attachments

(1 obsolete file)

Build fails with clang and warnings-as-errors:

 0:19.55 In file included from /home/keeler/mozilla-central/obj-x86_64-unknown-linux-gnu/widget/gtk/Unified_cpp_widget_gtk1.cpp:38:
 0:19.55 In file included from /home/keeler/mozilla-central/widget/gtk/nsPrintOptionsGTK.cpp:6:
 0:19.55 /home/keeler/mozilla-central/widget/gtk/nsPrintOptionsGTK.h:16:3: error: struct 'PrintData' was previously declared as a class [-Werror,-Wmismatched-tags]
 0:19.55   struct PrintData;
 0:19.55   ^
 0:19.55 /home/keeler/mozilla-central/obj-x86_64-unknown-linux-gnu/ipc/ipdl/_ipdlheaders/mozilla/embedding/PPrintingTypes.h:104:7: note: previous use is here
 0:19.55 class PrintData MOZ_FINAL
 0:19.55       ^
 0:19.55 /home/keeler/mozilla-central/widget/gtk/nsPrintOptionsGTK.h:16:3: note: did you mean class here?
 0:19.55   struct PrintData;
 0:19.55   ^~~~~~
 0:19.55   class
 0:19.55 1 error generated.
 0:19.55
Attached patch Fix PrintData declaration (obsolete) — Splinter Review
This worked for me on Linux and clang, but Waiting on try build to make sure I didn't break other configurations.
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Is there a relationship between widget/nsIPrintOptions.idl and embedding/components/printingui/ipc/PPrintingTypes.ipdlh ? I mention this because the former declares:

namespace mozilla {
namespace embedding {
  class PrintData;
}
}

and the latter declares:

namespace mozilla {
namespace embedding {

...

  struct PrintData {
    int32_t startPageRange;
    ...

(see https://hg.mozilla.org/mozilla-central/annotate/23f1f0369df5/widget/nsIPrintOptions.idl#l12 and https://hg.mozilla.org/mozilla-central/annotate/23f1f0369df5/embedding/components/printingui/ipc/PPrintingTypes.ipdlh#l6 )
FWIW, it looks like dholbert has already pushed some fixes for this issue:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a89d66fd2b6a

(see Bug 1082579 comment 21 and 22)
Comment on attachment 8574896 [details] [diff] [review]
Fix PrintData declaration

:dholbert got here first.
Attachment #8574896 - Attachment is obsolete: true
Let's just dup this to that.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1082579
You need to log in before you can comment on or make changes to this bug.