Compile error because of string and macro concatenation in TestPoisonArea.cpp that is illegal in C++11

RESOLVED DUPLICATE of bug 734490

Status

()

Core
Layout
RESOLVED DUPLICATE of bug 734490
6 years ago
6 years ago

People

(Reporter: Martin Jambor, Assigned: Martin Jambor)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 604003 [details] [diff] [review]
Proposed fix

User Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1
Build ID: 2012020800

Steps to reproduce:

I compiled Firefox from hg repository with trunk gcc - so technically
a development version of 4.8 but one that is still very similar to
4.7.0 which is being released and which I suspect will also issue an
error.



Actual results:

I got the following compile errors:

/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp: In function ‘uintptr_t ReservePoisonArea()’:
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:400:56: error: unable to find string literal operator ‘operator"" PRIxPTR’
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:409:14: error: unable to find string literal operator ‘operator"" PRIxPTR’
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:420:14: error: unable to find string literal operator ‘operator"" PRIxPTR’
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:428:14: error: unable to find string literal operator ‘operator"" PRIxPTR’
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:437:14: error: unable to find string literal operator ‘operator"" PRIxPTR’
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp: In function ‘uintptr_t ReservePositiveControl()’:
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:458:61: error: unable to find string literal operator ‘operator"" PRIxPTR’
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp: In function ‘uintptr_t ReserveNegativeControl()’:
/abuild/mjambor/moz/nonlto/layout/base/tests/TestPoisonArea.cpp:489:61: error: unable to find string literal operator ‘operator"" PRIxPTR’
make[7]: *** [TestPoisonArea.o] Error 1

This is another instance of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50917

The problem is that in C++11, preprocessor considers string literal followed
by a macro without a blank in between one token and does not expand
the macro.  Inserting blanks is enough to fix the issue, I'm attaching
a patch fixing the problem.



Expected results:

Well, it should have compiled :-)
(Assignee)

Updated

6 years ago
Hardware: x86 → x86_64

Updated

6 years ago
Assignee: nobody → mjambor
Component: Untriaged → Layout
Product: Firefox → Core
QA Contact: untriaged → layout

Comment 1

6 years ago
Will you request review from somebody? Probably from the layout component. https://wiki.mozilla.org/Modules/Core

Comment 2

6 years ago
Callek, can you look at this too? (like in bug 733867).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #604003 - Flags: review?(zackw)
The exact same patch has already been landed in bug 734490.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 734490

Updated

6 years ago
Attachment #604003 - Flags: review?(zackw)
You need to log in before you can comment on or make changes to this bug.