Closed Bug 943235 Opened 6 years ago Closed 6 years ago

logging.h:95:0: warning: "LOG" redefined, when building xpcom/io in unified mode

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Build warning, when building in unified mode:
{
 0:04.72 In file included from /scratch/work/builds/mozilla-inbound/mozilla/ipc/chromium/src/base/command_line.h:27:0,
 0:04.72                  from /scratch/work/builds/mozilla-inbound/mozilla/ipc/chromium/src/base/process_util.h:28,
 0:04.72                  from ../../dist/include/ipc/IPCMessageUtils.h:10,
 0:04.72                  from /scratch/work/builds/mozilla-inbound/mozilla/xpcom/io/nsStringStream.cpp:11,
 0:04.72                  from /scratch/work/builds/mozilla-inbound/obj/xpcom/io/Unified_cpp_xpcom_io1.cpp:29:
 0:04.72 Warning: enabled by default in /scratch/work/builds/mozilla-inbound/mozilla/ipc/chromium/src/base/logging.h: "LOG" redefined
 0:04.72 /scratch/work/builds/mozilla-inbound/mozilla/ipc/chromium/src/base/logging.h:95:0: warning: "LOG" redefined [enabled by default]
 0:04.72  #define LOG(info) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
 0:04.72  ^
 0:04.72 In file included from /scratch/work/builds/mozilla-inbound/obj/xpcom/io/Unified_cpp_xpcom_io1.cpp:11:0:
 0:04.72 /scratch/work/builds/mozilla-inbound/mozilla/xpcom/io/nsStorageStream.cpp:51:0: note: this is the location of the previous definition
 0:04.72  #define LOG(args) PR_LOG(GetStorageStreamLog(), PR_LOG_DEBUG, args)
 0:04.72  ^
}

nsStorageStream.cpp already has an #undef at the top to be sure its LOG() definition is the only one.

HOWEVER, when we build in unified mode, its LOG definition leaks into stuff that's concatenated to the .cpp file *after* it, and we end up complaining about LOG being redefined there as a result.

The obvious fix is to just #undef LOG at the end of nsStorageStream.cpp.
Blocks: buildwarning
Attached patch fix v1Splinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8338310 - Flags: review?(nfroyd)
Attachment #8338310 - Attachment description: 943235-fix.patch → fix v1
Blocks: 943238
Attachment #8338310 - Flags: review?(nfroyd) → review+
Keywords: checkin-needed
Flags: in-testsuite-
Summary: logging.h:95:0: warning: "LOG" redefined [enabled by default], when building xpcom/io in unified mode → logging.h:95:0: warning: "LOG" redefined, when building xpcom/io in unified mode
https://hg.mozilla.org/mozilla-central/rev/150932cb83bf
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.