我有一个函数,该函数具有double
作为参数的as指针,且该指针的条件为restrict
。请注意,英特尔编译器使用restrict
,但是__restrict__
在GCC的情况下,我们用替换了限定符。
void Stats::calc_flux_2nd(double* restrict data,
double* restrict datamean,
double* restrict w)
{
// ...
// Set a pointer to the field that contains w,
// either interpolated or the original
double* restrict calcw = w;
// ...
使用GCC或Clang可以毫无问题地编译该代码,但是IBM BlueGene编译器给出以下错误:
(W) Incorrect assignment of a restrict qualified pointer.
Only outer-to-inner scope assignments between restrict pointers are
allowed. This may result in incorrect program behavior.
我不了解如何解释此错误,因为我不更改变量的签名,也不知道我是在引入未定义行为还是IBM BlueGene编译器是否错误。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句