Closed Bug 15245 Opened 20 years ago Closed 20 years ago

Recent changes to nsGtkUtils.cpp broke pedantic C++ compilers

Categories

(Core :: XUL, defect, P3)

Sun
Solaris
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: tor, Assigned: ramiro)

Details

There's a longstanding bug in glib.h which defines NULL as a "(void *)0",
which causes problems with pedantic C++ compilers.  Your recent changes to
nsGtkUtils.cpp triggered this problem.  A simple rearrangement of header
files (so that NULL is defined before glib.h is included) fixes the problem:

Index: nsGtkUtils.cpp
===================================================================
RCS file: /cvsroot/mozilla/widget/src/gtk/nsGtkUtils.cpp,v
retrieving revision 1.13
diff -u -r1.13 nsGtkUtils.cpp
--- nsGtkUtils.cpp      1999/09/30 01:17:31     1.13
+++ nsGtkUtils.cpp      1999/09/30 05:03:43
@@ -16,13 +16,13 @@
  * Reserved.
  */

+#include <unistd.h>
+#include <string.h>
+
 #include "nsGtkUtils.h"

 #include <gdk/gdkx.h>
 #include <gdk/gdkprivate.h>
-
-#include <unistd.h>
-#include <string.h>

 #if defined(__osf__) && !defined(_XOPEN_SOURCE_EXTENDED)
 /*
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I checked it in.  Thanks.

marking fixed.
Status: RESOLVED → VERIFIED
code-level fix, marking VERIFIED
Status: VERIFIED → REOPENED
Something strange happened here - it looks like you applied the patch in 1.14
(applied on 9/29), then reversed it today with 1.15.  Judging from the cvs
comments, it looks like this was a mistake.  Could you please back out the
1.15 changes?  Thanks.
Im an idiot.  I screwed it up.  I backed out the last change.  Thanks, and
sorry.
Resolution: FIXED → ---
Clearing Fixed Resolution due to reopen.
so it's fixed properly now? Can someone who knows mark it fixed(and verified)?
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
yeah, marking fixed.
Status: RESOLVED → VERIFIED
coolio marking verified
You need to log in before you can comment on or make changes to this bug.