Skip to content

Commit dae9712

Browse files
committed
btl smcuda: suppress compiler warning
Put in an explicit cast to (double) to avoid a gcc 14 warning about a loss of precision compared to the implicit cast. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 9128c71 commit dae9712

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opal/mca/btl/smcuda/btl_smcuda_component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Copyright (c) 2023 Triad National Security, LLC. All rights
2222
* reserved.
2323
* Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights reserved.
24+
* Copyright (c) 2024 Jeffrey M. Squyres. All rights reserved.
2425
* $COPYRIGHT$
2526
*
2627
* Additional copyrights may follow
@@ -417,7 +418,7 @@ static int get_mpool_res_size(int32_t max_procs, size_t *out_res_size)
417418
* mpool_sm_component.c when sizeof(mca_common_sm_module_t) is
418419
* added.
419420
*/
420-
if (((double) size) * max_procs > LONG_MAX - 4096) {
421+
if (((double) size) * max_procs > (double) (LONG_MAX - 4096)) {
421422
return OPAL_ERR_VALUE_OUT_OF_BOUNDS;
422423
}
423424
size *= (size_t) max_procs;

0 commit comments

Comments
 (0)