Closed Bug 734036 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: Layout, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 734490

People

(Reporter: mjambor, Assigned: mjambor)

Details

Attachments

(1 file)

Attached patch Proposed fixSplinter Review
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 :-)
Hardware: x86 → x86_64
Assignee: nobody → mjambor
Component: Untriaged → Layout
Product: Firefox → Core
QA Contact: untriaged → layout
Will you request review from somebody? Probably from the layout component. https://wiki.mozilla.org/Modules/Core
Callek, can you look at this too? (like in bug 733867).
Status: UNCONFIRMED → NEW
Ever confirmed: true
The exact same patch has already been landed in bug 734490.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Attachment #604003 - Flags: review?(zackw)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: