Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 5 years ago

Language

C

Compiler

clang 9.0.0

Options
Warnings
Optimization
C11
-pedantic

Author

anonymous

over 5 years ago

$ clang prog.c -Wall -Wextra -O2 -march=native -std=c11 -pedantic
prog.c:31:16: warning: array index 100 is past the end of the array (which contains 100 elements) [-Warray-bounds]
       sum=sum+p[i][nmax];
               ^    ~~~~
prog.c:27:25: note: array 'p' declared here
void findMeanLine(int n,int p[][nmax]){
                        ^
prog.c:29:24: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
    double avg,avgLine[i];
                       ^
prog.c:28:14: note: initialize the variable 'i' to silence this warning
    int sum,i,j;
             ^
              = 0
prog.c:44:16: warning: format specifies type 'double' but the argument has type 'double *' [-Wformat]
  printf("%lf",avgLine);
          ~~~  ^~~~~~~
prog.c:46:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c:48:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main(){
^
prog.c:65:2: warning: no newline at end of file [-Wnewline-eof]
}
 ^
prog.c:60:20: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
    double avgLine[i];
                   ^
prog.c:49:11: note: initialize the variable 'i' to silence this warning
   int n,i;
          ^
           = 0
7 warnings generated.
Give integer n > 5 : p = 
6 10 6 2 1 4 
0 6 3 1 8 7 
5 3 7 4 9 10 
2 0 10 8 5 0 
4 6 0 10 3 10 
10 7 10 3 7 9 
p = 
0.0000000.0000000.0000000.0000000.0000000.000000
Exit Code:
0