Skip to content

Some examples use deprecated workspace functions. #725

@WarrenWeckesser

Description

@WarrenWeckesser

The workspace functions (e.g. CVodeGetWorkSpace, CVodeGetLinWorkspace, CVDiagGetWorkspace) are deprecated, but they are still used in many examples, so building the examples generates compiler warnings such as

cvDirectDemo_ls.c: In function ‘PrintFinalStats’:
cvDirectDemo_ls.c:871:3: warning: ‘CVodeGetWorkSpace’ is deprecated: Work space functions will be removed in version 8.0.0 [-Wdeprecated-declarations]
  871 |   retval = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw);
      |   ^~~~~~
In file included from cvDirectDemo_ls.c:63:
/home/warren/sundials730/include/cvode/cvode.h:194:5: note: declared here
  194 | int CVodeGetWorkSpace(void* cvode_mem, long int* lenrw, long int* leniw);
      |     ^~~~~~~~~~~~~~~~~
cvDirectDemo_ls.c:904:7: warning: ‘CVodeGetLinWorkSpace’ is deprecated: Work space functions will be removed in version 8.0.0 [-Wdeprecated-declarations]
  904 |       retval = CVodeGetLinWorkSpace(cvode_mem, &lenrwLS, &leniwLS);
      |       ^~~~~~
In file included from /home/warren/sundials730/include/cvode/cvode.h:21,
                 from cvDirectDemo_ls.c:63:
/home/warren/sundials730/include/cvode/cvode_ls.h:109:5: note: declared here
  109 | int CVodeGetLinWorkSpace(void* cvode_mem, long int* lenrwLS, long int* leniwLS);
      |     ^~~~~~~~~~~~~~~~~~~~
cvDirectDemo_ls.c:912:7: warning: ‘CVDiagGetWorkSpace’ is deprecated: Work space functions will be removed in version 8.0.0 [-Wdeprecated-declarations]
  912 |       retval = CVDiagGetWorkSpace(cvode_mem, &lenrwLS, &leniwLS);
      |       ^~~~~~
In file included from cvDirectDemo_ls.c:64:
/home/warren/sundials730/include/cvode/cvode_diag.h:51:5: note: declared here
   51 | int CVDiagGetWorkSpace(void* cvode_mem, long int* lenrwLS, long int* leniwLS);
      |     ^~~~~~~~~~~~~~~~~~

I don't think the examples should continue to use deprecated functions--ideally they should demonstrate recommended usage patterns. It appears the functions are only used as part of a display of summary statistics, so removing the calls should be straightforward.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions