This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: A possible bug
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Ivo Doko <ivo dot doko at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 7 Oct 2014 11:48:33 +0100
- Subject: Re: A possible bug
- Authentication-results: sourceware.org; auth=none
- References: <54337368 dot 4070407 at gmail dot com> <CAH6eHdRAzuo-dDSft17N04nmw=Ne2ydhp1_bxzReric2ce3j2A at mail dot gmail dot com> <5433B232 dot 6070401 at gmail dot com>
On 7 October 2014 10:28, Ivo Doko wrote:
> On 2014-10-07 10:57, Jonathan Wakely wrote:
>>
>> It's probably simply
>>
>> https://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition
>
>
> Once again I must apologise for spam, but this helped me solve the issue.
> Changing the declaration of function xorshift_engine::shift from
>
> shift(const result_type& val, const int_fast8_t& sh)
>
> to
>
> shift(const result_type& val, int_fast8_t sh)
>
> fixes the linker problem with optimisation disabled.
That's almost certainly an improvement anyway, the compiler can pass
an int_fast8_t in a register more efficiently than passing by
reference.
But you haven't actually fixed the root cause of the problem, which is
that you haven't defined your static variables.