C, C++11, ключевое слово «register», const double» требует «constexp и проблемы с версией с использованием компилятора IC++

Программы на C++. Форум разработчиков
Ответить
Гость
 C, C++11, ключевое слово «register», const double» требует «constexp и проблемы с версией с использованием компилятора I

Сообщение Гость »


I was able to run this c++ program in linux without any errors.
This time I am trying to run a c++ program named epa in Linux using cmd but this time time , I am facing some errors.

Код: Выделить всё

sadeed@sadeed-VirtualBox:~/epav2-20231025T013126Z-001/epav2/src/main/epa2$ icpx -std=c++11 -I../../include epamain.cpp -o epamain In file
included from epamain.cpp:24: In file included from ../../include/
greensFunction.h:6: ../../include/oopPoint.h:592:3: warning:
'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]   register T side1,side2,side3,avg;
^~~~~~~~~ ../../include/oopPoint.h:592:3: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-
Wdeprecated-register]   register T side1,side2,side3,avg;   ^~~~~~~~~ ../../include/oopPoint.h:592:3: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]   register T side1,side2,side3,avg;   ^~~~~~~~~ ../../
include/oopPoint.h:592:3: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register T side1,side2,side3,avg;   ^~~~~~~~~ ../../include/
oopPoint.h:606:3: warning: 'register' storage class specifier is
deprecated and incompatible with C++17 [-Wdeprecated-register]   register T side1,side2,side3,avg;   ^~~~~~~~~ ../../include/
oopPoint.h:606:3: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]   register T side1,side2,side3,avg;   ^~~~~~~~~ ../../include/oopPoint.h:606:3: warning: 'register' storage class specifier is
deprecated and incompatible with C++17 [-Wdeprecated-register]
register T side1,side2,side3,avg;   ^~~~~~~~~ ../../include/oopPoint.h:606:3: warning: 'register' storage class specifier is
deprecated and incompatible with C++17 [-Wdeprecated-register]   register T side1,side2,side3,avg;   ^~~~~~~~~ In file included from
epamain.cpp:26: In file included from ../../include/integEqn.h:16: In file included from ../../include/operator.h:23: In file included from
../../include/intgrect.h:19: ../../include/duffy.h:88:26: error: in-class initializer for static data member of type 'const double'
requires 'constexpr' specifier [-Wstatic-float-init]     static const double  errBnd = 1.0e-3;                          ^        ~~~~~~ ../../include/duffy.h:88:5: note: add 'constexpr'     static const
double  errBnd = 1.0e-3;     ^     constexpr  In file included from epamain.cpp:26: In file included from ../../include/integEqn.h:16: In
file included from ../../include/operator.h:23: ../../include/intgrect.h:59:26: error: in-class initializer for static data member
of type 'const double' requires 'constexpr' specifier [-Wstatic-float-init]     static const double  errBnd = 1e-5;
^        ~~~~ ../../include/intgrect.h:59:5: note:
add 'constexpr'     static const double  errBnd = 1e-5;     ^     constexpr  ../../include/intgrect.h:72:25: error: in-class initializer for static data member of type 'const double' requires 'constexpr' specifier [-Wstatic-float-init]     static const double errBnd = 1e-3;                         ^        ~~~~ ../../include/intgrect.h:72:5: note: add 'constexpr'
static const double errBnd = 1e-3;     ^     constexpr  In file included from epamain.cpp:32: In file included from ../../include/
FMALib.h:7: In file included from ../../include/FSFMM.H:23: ../../include/fmaOperation.H:152:3: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-
register]   register int i, j, loc;   ^~~~~~~~~ ../../include/fmaOperation.H:152:3: warning: 'register' storage class specifier is
deprecated and incompatible with C++17 [-Wdeprecated-register]   register int i, j, loc;   ^~~~~~~~~ ../../include/fmaOperation.H:152:3: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]   register int i, j, loc;   ^~~~~~~~~ 11 warnings and 3 errors generated.`
Last time ,
I ran the epamain.cpp using

Код: Выделить всё

icpx -I../../include epamain.cpp -o epamain
and ran successfully,
when I ran now, I received 14 errors,
changing the version of c++ now gives me three errors only.

Код: Выделить всё

icpx -std=c++11 -I../../include epamain.cpp -o epamain 
I don't want to change the code, since it is an old project.
I want to run it like before but wonder about the errors(still 3 errors) as above show up:


Источник: https://stackoverflow.com/questions/781 ... on-issue-u
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»