Skip to content
Back to formatted view

Raw Message

Message-ID: <20200323203403.57fa610d@trisector>
Date: 2020-03-23T17:34:03Z
From: Ivan Krylov
Subject: [R-pkg-devel]  OpenMP variable not specified in enclosing 'parallel'
In-Reply-To: <DB8PR10MB3784AA11DE5966920B02A317A4F00@DB8PR10MB3784.EURPRD10.PROD.OUTLOOK.COM>

On Mon, 23 Mar 2020 15:29:20 +0100
Emil Sj?rup <emilsjoerup at live.dk> wrote:

> const int iMaxLag = 20;

> error: ?iMaxLag? not specified in enclosing ?parallel?

> error: ?iMaxLag? is predetermined ?shared? for ?shared?

This looks like a compiler bug to me. g++ seems to forget the rule that
"const" variables are supposed to be shared despite the default(none)
clause.

In a similar situation (g++ being confused about the sharing
status of a hidden temporary variable it had internally created) I had
to remove default(none) and leave a comment explaining that the code
would not compile otherwise.

-- 
Best regards,
Ivan