mirror of https://github.com/ecmwf/eccodes.git
Compiler warnings: variable length array used
This commit is contained in:
parent
2b93ef50ee
commit
01cf5902b9
|
@ -118,7 +118,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
{
|
||||
pthread_t workers[NUM_THREADS];
|
||||
pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t));
|
||||
for (i = 0; i < NUM_THREADS; i++) {
|
||||
struct v *data = (struct v *) malloc(sizeof(struct v));
|
||||
data->number = i;
|
||||
|
@ -139,6 +139,7 @@ int main(int argc, char **argv)
|
|||
pthread_join(workers[i], NULL);
|
||||
}
|
||||
}
|
||||
free (workers);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -79,7 +79,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
{
|
||||
pthread_t workers[NUM_THREADS];
|
||||
pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t));
|
||||
for (i = 0; i < NUM_THREADS; i++) {
|
||||
struct v *data = (struct v *) malloc(sizeof(struct v));
|
||||
data->number = i;
|
||||
|
@ -99,6 +99,7 @@ int main(int argc, char **argv)
|
|||
pthread_join(workers[i], NULL);
|
||||
}
|
||||
}
|
||||
free (workers);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -127,7 +127,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
{
|
||||
pthread_t workers[NUM_THREADS];
|
||||
pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t));
|
||||
for (i = 0; i < NUM_THREADS; i++) {
|
||||
struct v *data = (struct v *) malloc(sizeof(struct v));
|
||||
data->number = i;
|
||||
|
@ -148,6 +148,7 @@ int main(int argc, char **argv)
|
|||
pthread_join(workers[i], NULL);
|
||||
}
|
||||
}
|
||||
free (workers);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue