Re: Compile errors with basic jsapi integration

Kent Williams <[email protected]> Mon, 26 Feb 2018 09:10:32 -0600
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
What version of clang?  What version of SpiderMonkey? I've tried a CLang 
compile on Centos7 -- the free Red Hat 7 -- and run into these problems 
or something similar.

I would think there should be a way to compile with Clang, as that's the 
system compiler on OS X now.


On 02/25/2018 01:57 PM, [email protected] wrote:
> I'm trying to build a basic hello world style program with JSAPI. I've copied the "boilerplate code necessary for a minimal JSAPI application" from the JSAPI User Guide (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_User_Guide) and I'm trying to build on OS X with the following command:
>
> clang++  -std=c++11 -Iinclude -Llib  ew-test.cpp  -lmozjs-60a1 -lz -o ew-test
>
> I'm getting a bunch of compile errors. The output up to the first error is:
> In file included from ew-test.cpp:1:
> In file included from include/jsapi.h:15:
> In file included from include/mozilla/Range.h:12:
> include/mozilla/Span.h:194:3: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    operator=(const span_iterator<Span, IsConst>&) = default;
>    ^
>                                                   const
> include/mozilla/Span.h:208:47: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    MOZ_SPAN_NON_CONST_CONSTEXPR span_iterator& operator++()
>                                                ^
>                                                             const
> include/mozilla/Span.h:215:27: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    constexpr span_iterator operator++(int)
>                            ^
>                                            const
> include/mozilla/Span.h:222:47: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    MOZ_SPAN_NON_CONST_CONSTEXPR span_iterator& operator--()
>                                                ^
>                                                             const
> include/mozilla/Span.h:229:27: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    constexpr span_iterator operator--(int)
>                            ^
>                                            const
> include/mozilla/Span.h:243:41: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    MOZ_SPAN_GCC_CONSTEXPR span_iterator& operator+=(difference_type n)
>                                          ^
>                                                                        const
> include/mozilla/Span.h:258:28: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
>    constexpr span_iterator& operator-=(difference_type n)
>                             ^
>                                                           const
> include/mozilla/Span.h:183:5: error: statement not allowed in constexpr constructor
>      MOZ_RELEASE_ASSERT(span == nullptr ||
>      ^
> include/mozilla/Assertions.h:453:5: note: expanded from macro 'MOZ_RELEASE_ASSERT'
>      MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
>      ^
> include/mozilla/MacroArgs.h:76:5: note: expanded from macro 'MOZ_PASTE_PREFIX_AND_ARG_COUNT'
>      MOZ_CONCAT, (aPrefix, MOZ_ARG_COUNT(__VA_ARGS__)))
>      ^
>
> I can't figure out where I'm going wrong. Any help would be appreciated.
> _______________________________________________
> dev-tech-js-engine mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-js-engine

_______________________________________________
dev-tech-js-engine mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine