Record Detail

Compile Error

/in/hotel-main.c:1:0: error: ISO C forbids an empty translation unit [-Werror=pedantic]
cc1: all warnings being treated as errors
/in/hotel-mt.c:5:1: error: useless storage class specifier in empty declaration [-Werror]
 };
 ^
/in/hotel-mt.c: In function 'main':
/in/hotel-mt.c:11:7: error: variable 'check1in' set but not used [-Werror=unused-but-set-variable]
 char *check1in;
       ^~~~~~~~
/in/hotel-mt.c:10:6: error: variable 'roomtype' set but not used [-Werror=unused-but-set-variable]
 int *roomtype;
      ^~~~~~~~
/in/hotel-mt.c: At top level:
/in/hotel-mt.c:29:15: error: conflicting types for 'checkin'
 struct info * checkin()
               ^~~~~~~
/in/hotel-mt.c:6:8: note: previous declaration of 'checkin' was here
 char * checkin();
        ^~~~~~~
/in/hotel-mt.c: In function 'checkin':
/in/hotel-mt.c:33:13: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char **' [-Werror=format=]
     scanf("%s",&info1.name);
             ^
/in/hotel-mt.c:37:13: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char **' [-Werror=format=]
     scanf("%s",&info1.arrival);
             ^
/in/hotel-mt.c:45:12: error: function returns address of local variable [-Werror=return-local-addr]
     return &info1;
            ^~~~~~
/in/hotel-mt.c: In function 'changenight':
/in/hotel-mt.c:54:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
/in/hotel-mt.c: In function 'changebreakfast':
/in/hotel-mt.c:61:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
/in/hotel-db.c: In function 'main':
/in/hotel-db.c:4:19: error: ISO C forbids nested functions [-Werror=pedantic]
     int n; int i; int k
                   ^~~
/in/hotel-db.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'FILE'
 FILE *fpWrite=fopen("database.txt","w");
 ^~~~
/in/hotel-db.c:10:7: error: statement with no effect [-Werror=unused-value]
 for (i==0;i<=n;i=i++)
      ~^~~
/in/hotel-db.c:10:17: error: operation on 'i' may be undefined [-Werror=sequence-point]
 for (i==0;i<=n;i=i++)
                ~^~~~
/in/hotel-db.c:12:30: error: 'room' undeclared (first use in this function)
         fprintf(fpWrite,"%d",room[i].num);
                              ^~~~
/in/hotel-db.c:12:30: note: each undeclared identifier is reported only once for each function it appears in
/in/hotel-db.c:16:14: error: 'k' undeclared (first use in this function)
         for (k==0,k<=room[i].visitor,k++)
              ^
/in/hotel-db.c:16:18: error: left-hand operand of comma expression has no effect [-Werror=unused-value]
         for (k==0,k<=room[i].visitor,k++)
                  ^
/in/hotel-db.c:16:37: error: left-hand operand of comma expression has no effect [-Werror=unused-value]
         for (k==0,k<=room[i].visitor,k++)
                                     ^
/in/hotel-db.c:16:41: error: expected ';' before ')' token
         for (k==0,k<=room[i].visitor,k++)
                                         ^
/in/hotel-db.c:16:41: error: expected expression before ')' token
cc1: all warnings being treated as errors
/in/hotel-ll.c:6:1: error: useless storage class specifier in empty declaration [-Werror]
 } ;
 ^
/in/hotel-ll.c: In function 'main':
/in/hotel-ll.c:12:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     while (judge=="yes")
                 ^~
/in/hotel-ll.c:15:13: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char **' [-Werror=format=]
     scanf("%s",&judge);
             ^
/in/hotel-ll.c:16:14: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if (judge!="yes") continue;
              ^~
/in/hotel-ll.c:24:13: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char **' [-Werror=format=]
     scanf("%s",&room->type);
             ^
/in/hotel-ll.c:25:19: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if (room->type=="single")
                   ^~
/in/hotel-ll.c:35:19: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if (room->type=="double")
                   ^~
/in/hotel-ll.c:45:19: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if (room->type=="dorm")
                   ^~
/in/hotel-ll.c:57:17: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char **' [-Werror=format=]
         scanf("%s", &room->name[i]);
                 ^
/in/hotel-ll.c:61:17: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char **' [-Werror=format=]
         scanf("%s",&room->arrival[i]);
                 ^
/in/hotel-ll.c:9:36: error: unused variable 'm' [-Werror=unused-variable]
     char *judge; int n; int i; int m; int roomprice;
                                    ^
/in/hotel-ll.c:9:22: error: variable 'n' set but not used [-Werror=unused-but-set-variable]
     char *judge; int n; int i; int m; int roomprice;
                      ^
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 2
Language
C
Submit At
2018-07-17 13:37:22
Judged At
2018-07-17 13:37:22
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes