Skip to content

Calling correct functions according to proper types#481

Open
TLCFEM wants to merge 2 commits intoopencollab:masterfrom
TLCFEM:patch-1
Open

Calling correct functions according to proper types#481
TLCFEM wants to merge 2 commits intoopencollab:masterfrom
TLCFEM:patch-1

Conversation

@TLCFEM
Copy link
Copy Markdown
Contributor

@TLCFEM TLCFEM commented Apr 9, 2026

Incorrect types would compile just fine but may result in errors when LTO is enabled.
The following is a typical one.

parpack-src/pcnaitr.f:410: error: type of 'pdvout' does not match original declaration [-Werror=lto-type-mismatch]
  410 |      &                  '_naitr: B-norm of the current residual is')
      | 
parpack-src/pdvout.f:21: note: 'pdvout' was previously declared here
   21 |       SUBROUTINE PDVOUT( COMM , LOUT, N, SX, IDIGIT, IFMT )
      | 
parpack-src/pdvout.f:21: note: code may be misoptimized unless '-fno-strict-aliasing' is used

@fghoussen
Copy link
Copy Markdown
Collaborator

Not sure about your fix. Can you detail it?

if (msglvl .gt. 1) then
call pivout (comm, logfil, 1, [j], ndigit,
& '_naitr: generating Arnoldi vector number')
call pzvout (comm, logfil, 1, [rnorm], ndigit,
Copy link
Copy Markdown
Contributor Author

@TLCFEM TLCFEM Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rnorm is declared as a double, pzvout expects a complex*16.

if (msglvl .gt. 1) then
call pivout (comm, logfil, 1, [j], ndigit,
& '_naitr: generating Arnoldi vector number')
call pdvout (comm, logfil, 1, [rnorm], ndigit,
Copy link
Copy Markdown
Contributor Author

@TLCFEM TLCFEM Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rnorm is declared as a float, pdvout expects a double.

if (msglvl .gt. 1) then
call pivout (comm, logfil, 1, [j], ndigit,
& '_naitr: generating Arnoldi vector number')
call pcvout (comm, logfil, 1, [rnorm], ndigit,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rnorm is declared as a float, pcvout expects a complex*8.

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

Successfully merging this pull request may close these issues.

2 participants