]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: Fix signatures of coarray API and caf_single.
authorAndre Vehreschild <vehre@gcc.gnu.org>
Wed, 18 Jun 2025 07:23:32 +0000 (09:23 +0200)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 26 Feb 2026 17:18:23 +0000 (09:18 -0800)
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.

libgfortran/caf/libcaf.h
libgfortran/caf/single.c

index 06617a142b86174ba6eace6073b8c89840487ac7..022ac5c365f7279361f815ed6a37a37b3f6186a3 100644 (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);
 
index 7e02dff25d883ebefca045ec8b46114e21ad5093..43c83e65ec4ce18ea05ed721c3230e2dfcaf7b29 100644 (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);
        }