DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.11k stars 256 forks source link

GraphBLAS: Avoid possibility of compatible types in `_Generic` selections #755

Closed mmuetzel closed 5 months ago

mmuetzel commented 5 months ago

If I understand the motivation for these generic selections correctly, they are meant to provide "specializations" if the input is part of some enumerations. The "generic" function is given by the line with the int type. The int type in those lists can cause issues if int is the underlying type for enumerations (in some implementations).

Avoid that possible issue by using the keyword default for the "generic" function.

This should be fixing #753.

Additionally, avoid adding incompatible command line options for clang-cl in the build rules of LAGraph (a clang compiler with MSVC-compatible command line interface).

DrTimothyAldenDavis commented 5 months ago

Great solution; I was worried that I would have to introduce a major breaking change to fix that macro, forcing me to go to GarphBLAS 10.0.0. This change doesn't need that.