Closed Bug 1419002 Opened 2 years ago Closed 2 years ago

JS_BROKEN_GCC_ATTRIBUTE_WARNING is not defined for GCC versions after 6.4

Categories

(Core :: JavaScript Engine, defect, P5)

defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

Due to a bug, GCC warns about forward declarations like:

  class JS_PUBLIC_API(Foo);

If the definition of Foo has already been seen.

Bug 1346389 added JS_BROKEN_GCC_ATTRIBUTE_WARNING, which is conditionally defined for GCC versions <= 6.4 and can be used to ignore these warnings.

However this bug is still not fixed in latest GCC versions and building with GCC version > 6.4 will generate these warnings.

The GCC bug is here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044
Priority: -- → P5
GCC 8 feature development has finished and there's no indication the bug will be fixed, so here's a patch to extend this macro to cover GCC up to 8.0.
Assignee: nobody → jcoppeard
Attachment #8930086 - Flags: review?(jwalden+bmo)
Comment on attachment 8930086 [details] [diff] [review]
bug1419002-gcc-forward-decls

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

::: js/src/jstypes.h
@@ +96,5 @@
>  // gcc is buggy and warns on our attempts to JS_PUBLIC_API our
>  // forward-declarations or explicit template instantiations.  See
>  // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044>.  Add a way to detect
>  // that so we can locally disable that warning.
> +#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 8 || (__GNUC__ == 8 && __GNUC_MINOR__ == 0))

Mind splitting this into

#if MOZ_IS_GCC
#  if !MOZ_GCC_VERSION_AT_LEAST(8, 0, 0)
#    define JS_BROKEN_GCC_ATTRIBUTE_WARNING
#  endif
#endif

so we don't have to touch the entirety of the condition, just the parts of it that are actually busted?
Attachment #8930086 - Flags: review?(jwalden+bmo) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b6b9f1e29a9
Extend JS_BROKEN_GCC_ATTRIBUTE_WARNING up to GCC 8.0 r=Waldo
https://hg.mozilla.org/mozilla-central/rev/0b6b9f1e29a9
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.