Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug_1315 and icb_arpack_c initialize array size through (non-const) variables #387

Open
dariomangoni opened this issue Jan 11, 2023 · 1 comment

Comments

@dariomangoni
Copy link

dariomangoni commented Jan 11, 2023

Both bug_1315_single.c and bug_1315_double.c declare an array through a non-const integer variable N, at line 30:

a_int N = 1000;
...
float resid[N];
  • the C language does not allow to initialize an array size with variables at all, even if are const;
  • the C++ language it at least requires the const attribute.

Their compilation clearly triggers a lot of errors. How can this code compile?
What am I missing?

BTW, also the icb_arpack_c.c code is affected by the same problem.

Where/how to reproduce the problem

  • arpack-ng: db55a7f
  • OS: Win10
  • compiler: MSVC
  • environment: set through Intel oneApi for x64
  • configure: cmake -DBLA_VENDOR=Intel10_64lp
  • input data: none

Steps to reproduce the problem

  • run bug_1315_single or bug_1315_double

Error message

error C2057: expected constant expression

@dariomangoni dariomangoni changed the title bug_1315 initialize array size by (non-const) variables bug_1315 initialize array size through (non-const) variables Jan 11, 2023
@dariomangoni dariomangoni changed the title bug_1315 initialize array size through (non-const) variables bug_1315 and icb_arpack_c initialize array size through (non-const) variables Jan 11, 2023
@fghoussen
Copy link
Collaborator

Feel free to propose a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants