Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix warning by putting the array only where it's needed
authorAugustin Degomme <degomme@wasabi>
Fri, 6 Jul 2018 13:25:38 +0000 (15:25 +0200)
committerAugustin Degomme <degomme@wasabi>
Fri, 6 Jul 2018 13:25:38 +0000 (15:25 +0200)
include/smpi/smpi.h
src/smpi/bindings/smpi_pmpi.cpp

index f64d602..51f0939 100644 (file)
@@ -130,10 +130,6 @@ enum ERROR_ENUM {
     FOREACH_ERROR(GENERATE_ENUM)
 };
 
     FOREACH_ERROR(GENERATE_ENUM)
 };
 
-static const char *smpi_error_string[] = {
-    FOREACH_ERROR(GENERATE_STRING)
-};
-
 #define MPI_ERRCODES_IGNORE (int *)0
 #define MPI_IDENT     0
 #define MPI_SIMILAR   1
 #define MPI_ERRCODES_IGNORE (int *)0
 #define MPI_IDENT     0
 #define MPI_SIMILAR   1
index 8939bbf..b0f7cc3 100644 (file)
@@ -209,6 +209,9 @@ int PMPI_Error_class(int errorcode, int* errorclass) {
 }
 
 int PMPI_Error_string(int errorcode, char* string, int* resultlen){
 }
 
 int PMPI_Error_string(int errorcode, char* string, int* resultlen){
+  static const char *smpi_error_string[] = {
+    FOREACH_ERROR(GENERATE_STRING)
+  };
   *resultlen = strlen(smpi_error_string[errorcode]);
   strncpy(string, smpi_error_string[errorcode], *resultlen);
   return MPI_SUCCESS;  
   *resultlen = strlen(smpi_error_string[errorcode]);
   strncpy(string, smpi_error_string[errorcode], *resultlen);
   return MPI_SUCCESS;