Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread William Dunlap
With gcc 8.3.0, gfortran 8.3.0, and ld 2.33.1 from the mingw64 part of rtools40 on Windows, if I misdefine the typedef FC_LEN_T and use the -flto flag I get the sort of error messages that you report. c:\tmp\fortran>cat main.c #include #include #ifdef USE_INT typedef int FC_LEN_T; #endif

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread Tomas Kalibera
My recommendation would be to try to minimize the example (package) as much as possible so that it still has the problem, and then try to investigate why exactly/where is the type mismatch. This is what helped me debug similar issues - sometimes it was hard to tell from the Fortran warnings

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread Pierre Lafaye de Micheaux
My file myzhpevx.cpp starts with: #define USE_FC_LEN_T #include #include "Rmath.h" #ifdef FC_LEN_T extern "C" { void zhpevxC(char **jobz, char **range, char **uplo, int *n, Rcomplex *ap, double *vl, double *vu, int *il, int *iu, double *abstol, int *m, double *w, Rcomplex *z, int

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread William Dunlap
Have you tried what is recommended in https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html ? For arguments of CHARACTER type, the character length is passed as a hidden argument at the end of the argument list. For deferred-length strings, the value is passed by reference,

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread Pierre Lafaye de Micheaux
Hello Bill, Thank you for your insight. First, my impression, is that the problem comes from how I declare the type of the function itself (and not its parameters), since the first (and only warning they seen on the CRAN) message is: myzhpevx.cpp:13:16: warning: type of �zhpevx_� does not

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread Pierre Lafaye de Micheaux
Dear Ivan, Thank you very much for your response. I do not have more information than the one I gave in my previous email. (And on top of that, the computer I was using with Debian SID, a recent version of gfortran and the last version of R-devel, just broke.) My problem is that the CRAN team

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread Ivan Krylov
On Fri, 3 Jul 2020 00:15:27 + Pierre Lafaye de Micheaux wrote: >Found the following significant warnings: >myzhpevx.cpp:13:23: warning: type of _zhpevx__ does not match > original declaration [-Wlto-type-mismatch] I managed to reproduce the warning on R-devel r78607 built with