It errors in C because the argument is labeled with const, but there does not seem to be a way in Fortran to indicate an array is read only.
> On May 13, 2024, at 10:21 PM, Runjian Wu <[email protected]> wrote: > > I only know the "intent(in)" attribute for the dummy arguments. > > In the counter function VecGetArrayRead(..), if I write values, will the > compiler report an error? > > Runjian > > On Mon, May 13, 2024 at 9:36 PM Barry Smith <[email protected] > <mailto:[email protected]>> wrote: >> >> I couldn't find a way in Fortran to declare an array as read-only. Is >> there such support? >> >> Barry >> >> >>> On May 13, 2024, at 7:28 AM, Runjian Wu <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> This Message Is From an External Sender >>> This message came from outside your organization. >>> Hi all, >>> >>> I have a question about VecGetArrayReadF90(...). If I use >>> VecGetArrayReadF90(...), I can still write entries into the array like >>> VecGetArrayF90(...). Is it possible to report an error during compile >>> process? >>> >>> Thanks, >>> >>> Runjian Wu >>
