Fortran: Fix signatures of coarray API and caf_single.

The teams argument to some functions was marked as unused in the header.
With upcoming caf_shmem this is incorrect, given the mark is repeated in
caf_single.

libgfortran/ChangeLog:

	* caf/libcaf.h (_gfortran_caf_failed_images): Team attribute is
	used now in some libs.
	(_gfortran_caf_image_status): Same.
	(_gfortran_caf_stopped_images): Same.
	* caf/single.c (caf_internal_error): Use correct printf function
	to handle va_list.
This commit is contained in:
Andre Vehreschild
2025-06-18 09:23:32 +02:00
committed by Jerry DeLisle
parent 5e12047d2c
commit 6a009fddc9
2 changed files with 4 additions and 7 deletions

View File

@@ -175,12 +175,9 @@ void _gfortran_caf_event_post (caf_token_t, size_t, int, int *, char *, size_t);
void _gfortran_caf_event_wait (caf_token_t, size_t, int, int *, char *, size_t);
void _gfortran_caf_event_query (caf_token_t, size_t, int, int *, int *);
void _gfortran_caf_failed_images (gfc_descriptor_t *,
caf_team_t * __attribute__ ((unused)), int *);
int _gfortran_caf_image_status (int, caf_team_t * __attribute__ ((unused)));
void _gfortran_caf_stopped_images (gfc_descriptor_t *,
caf_team_t * __attribute__ ((unused)),
int *);
void _gfortran_caf_failed_images (gfc_descriptor_t *, caf_team_t *, int *);
int _gfortran_caf_image_status (int, caf_team_t *);
void _gfortran_caf_stopped_images (gfc_descriptor_t *, caf_team_t *, int *);
void _gfortran_caf_random_init (bool, bool);

View File

@@ -129,7 +129,7 @@ caf_internal_error (const char *msg, int *stat, char *errmsg,
*stat = 1;
if (errmsg_len > 0)
{
int len = snprintf (errmsg, errmsg_len, msg, args);
int len = vsnprintf (errmsg, errmsg_len, msg, args);
if (len >= 0 && errmsg_len > (size_t) len)
memset (&errmsg[len], ' ', errmsg_len - len);
}