Closed Bug 1021001 Opened 5 years ago Closed 5 years ago

Silence some GCC warnings again

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33
Tracking Status
firefox32 --- fixed
firefox33 --- fixed

People

(Reporter: jorendorff, Assigned: Waldo)

Details

Attachments

(2 files)

So you can share my pain:

In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsapi.h:21,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/builtin/Object.h:10,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/builtin/Object.cpp:7:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsapi.h:21,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/builtin/SIMD.h:10,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/builtin/SIMD.cpp:14:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Nursery.h:13,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Nursery-inl.h:13,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Nursery.cpp:10:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:44:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoCheckCannotGC);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Statistics.h:13,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Statistics.cpp:7:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:44:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoCheckCannotGC);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/StoreBuffer.h:19,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/StoreBuffer.cpp:9:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:44:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoCheckCannotGC);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from /home/jorendorff/dev/mozilla-inbound/js/src/jspubtd.h:19:0,
                 from ../../dist/include/js/HeapAPI.h:12,
                 from ../../dist/include/js/GCAPI.h:12,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Tracer.h:12,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/gc/Tracer.cpp:7:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:44:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoCheckCannotGC);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from /home/jorendorff/dev/mozilla-inbound/js/src/jscntxt.h:15:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpEngine.h:34,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpAST.h:34,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpAST.cpp:31:
/home/jorendorff/dev/mozilla-inbound/js/src/vm/Runtime.h:1207:17: warning: inline function ‘bool JSRuntime::isAtomsZone(JS::Zone*)’ used but never defined [enabled by default]
     inline bool isAtomsZone(JS::Zone *zone);
                 ^
In file included from /home/jorendorff/dev/mozilla-inbound/js/src/jscntxt.h:15:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpEngine.h:34,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpAST.h:34,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpParser.h:34,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/irregexp/RegExpParser.cpp:31:
/home/jorendorff/dev/mozilla-inbound/js/src/vm/Runtime.h:1207:17: warning: inline function ‘bool JSRuntime::isAtomsZone(JS::Zone*)’ used but never defined [enabled by default]
     inline bool isAtomsZone(JS::Zone *zone);
                 ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsapi.h:21,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsapi.cpp:11:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from /home/jorendorff/dev/mozilla-inbound/js/src/jsdate.h:14:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsdate.cpp:18:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsapi.h:21,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsexn.h:14,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsexn.cpp:11:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from /home/jorendorff/dev/mozilla-inbound/js/src/jspubtd.h:19:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsfriendapi.h:15,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsproxy.h:12,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsproxy.cpp:7:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsapi.h:21,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/vm/DebuggerMemory.h:10,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/vm/DebuggerMemory.cpp:7:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
In file included from ../../dist/include/js/Utility.h:26:0,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/jsalloc.h:18,
                 from ../../dist/include/js/MemoryMetrics.h:19,
                 from /home/jorendorff/dev/mozilla-inbound/js/src/vm/MemoryMetrics.cpp:7:
/home/jorendorff/dev/mozilla-inbound/js/src/NamespaceImports.h:35:21: warning: type attributes ignored after type is already defined [-Wattributes]
 class JS_PUBLIC_API(AutoGCRooter);
                     ^
/home/jorendorff/dev/mozilla-inbound/js/src/jstypes.h:73:41: note: in definition of macro ‘JS_PUBLIC_API’
 #  define JS_PUBLIC_API(t)   MOZ_EXPORT t
                                         ^
Assignee: nobody → jorendorff
Attachment #8435038 - Flags: review?(terrence)
Comment on attachment 8435038 [details] [diff] [review]
bug_1021001_gcc_warnings-v1.patch

Review of attachment 8435038 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8435038 - Flags: review?(terrence) → review+
Comment on attachment 8435038 [details] [diff] [review]
bug_1021001_gcc_warnings-v1.patch

Review of attachment 8435038 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/NamespaceImports.h
@@ +40,5 @@
>  class MOZ_STACK_CLASS SourceBufferHolder;
>  
>  class HandleValueArray;
>  
> +class AutoCheckCannotGC;

Note clang 3.3 on linux doesn't compile without this - see bug 1013531 comment 12.
Argh. Sorry, I just landed this without seeing your comment.

https://hg.mozilla.org/integration/mozilla-inbound/rev/6775154c5cf2

Let me look at it some more and see exactly what causes GCC to emit this warning, and I'll try to fix it better.
https://hg.mozilla.org/mozilla-central/rev/6775154c5cf2
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Assignee: jorendorff → jwalden+bmo
Comment on attachment 8437029 [details] [diff] [review]
Fix the clang compile error by making GCAPI.h the sole provider of AutoCheckCannotGC

Review of attachment 8437029 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8437029 - Flags: review?(terrence) → review+
Comment on attachment 8437029 [details] [diff] [review]
Fix the clang compile error by making GCAPI.h the sole provider of AutoCheckCannotGC

https://hg.mozilla.org/integration/mozilla-inbound/rev/f5a32d4dc243

Just missed uplift, alas.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): this bug!
User impact if declined: can't build aurora tree AT ALL with clang on linux
Testing completed (on m-c, etc.): landed on m-c, built locally in unified/non-unified configs with gcc and clang
Risk to taking this patch (and alternatives if risky): none
String or IDL/UUID changes made by this patch: N/A
Attachment #8437029 - Flags: approval-mozilla-aurora?
Target Milestone: mozilla32 → mozilla33
Comment on attachment 8437029 [details] [diff] [review]
Fix the clang compile error by making GCAPI.h the sole provider of AutoCheckCannotGC

Aurora approval granted.
Attachment #8437029 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.