Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 74948d53 authored by gsell's avatar gsell
Browse files

gcc 9.2 warning in nsga2 fixed

parent 33a9bd19
No related branches found
No related tags found
1 merge request!200Resolve "fixes for gcc 9.2 warning"
...@@ -50,7 +50,7 @@ int main(int argc, char* argv[]) ...@@ -50,7 +50,7 @@ int main(int argc, char* argv[])
/* other variables */ /* other variables */
int state = -1; int state = -1;
char statefile[FILE_NAME_LENGTH]; char *statefile;
int result; int result;
/* reading command line parameters */ /* reading command line parameters */
...@@ -61,7 +61,7 @@ int main(int argc, char* argv[]) ...@@ -61,7 +61,7 @@ int main(int argc, char* argv[])
sscanf(argv[3], "%lf", &poll); sscanf(argv[3], "%lf", &poll);
/* generate name of statefile */ /* generate name of statefile */
sprintf(statefile, "%ssta", filenamebase); asprintf(&statefile, "%ssta", filenamebase);
/* main loop */ /* main loop */
while (state != 6) /* stop state for selector */ while (state != 6) /* stop state for selector */
......
...@@ -94,7 +94,7 @@ void write_pop(char* filename, pop* pp, int size) ...@@ -94,7 +94,7 @@ void write_pop(char* filename, pop* pp, int size)
int i; int i;
FILE *fp; FILE *fp;
assert(0 <= size <= pp->size); assert(0 <= size || size <= pp->size);
fp = fopen(filename, "w"); fp = fopen(filename, "w");
assert(fp != NULL); assert(fp != NULL);
...@@ -129,4 +129,4 @@ int check_file(char* filename) ...@@ -129,4 +129,4 @@ int check_file(char* filename)
return (0); /* file is ready for writing */ return (0); /* file is ready for writing */
else else
return (1); /* file is not ready for writing */ return (1); /* file is not ready for writing */
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment