Skip to content

lapack/laed3: fix MinGW build by matching LAMC3 prototype#5744

Open
nakatamaho wants to merge 1 commit intoOpenMathLib:developfrom
nakatamaho:fix/slamc3
Open

lapack/laed3: fix MinGW build by matching LAMC3 prototype#5744
nakatamaho wants to merge 1 commit intoOpenMathLib:developfrom
nakatamaho:fix/slamc3

Conversation

@nakatamaho
Copy link
Copy Markdown

Summary

This PR fixes a MinGW build failure in lapack/laed3.

common_interface.h declares slamc3 with return type FLOATRET
(when NEED_F2CCONV is active), but laed3_single.c and
laed3_parallel.c redeclare LAMC3 as returning FLOAT.

This leads to conflicting-type errors such as:

error: conflicting types for ‘slamc3_’; have ‘float(float *, float *)’
note: previous declaration of ‘slamc3_’ with type ‘double(float *, float *)’

Fix
change the local LAMC3 prototype in:
lapack/laed3/laed3_single.c
lapack/laed3/laed3_parallel.c
from FLOAT to FLOATRET so it matches the shared declaration in
common_interface.h

Additionally, this PR undefines the Windows max macro before the local
max macro definition in laed3_parallel.c to avoid macro redefinition
warnings during MinGW/Windows builds.

Why this is correct

The shared interface already defines the ABI-visible declaration for
slamc3. The local declarations in the two laed3 translation units
should match that interface exactly. Using FLOATRET restores that
consistency and removes the MinGW conflicting-type failure.

The max change does not alter behavior; it only avoids a warning caused
by windows.h / minwindef.h defining max as a macro.

Notes

I have verified that this change addresses the MinGW compile failure
reported in slaed3_single.obj / slaed3_parallel.obj.

I have not changed the surrounding logic or numerical code paths.
This PR is intentionally minimal and limited to fixing the declaration
mismatch and the Windows macro warning.

common_interface.h declares slamc3 as returning FLOATRET when
NEED_F2CCONV is enabled, but laed3_single.c and laed3_parallel.c
redeclared LAMC3 as returning FLOAT. This causes conflicting-type
errors in MinGW builds.

Use FLOATRET for the local LAMC3 prototype so it matches the shared
declaration. Also undefine the Windows max macro before the local
max definition in laed3_parallel.c to avoid macro redefinition
warnings.
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.

1 participant