Record Detail

Runtime Error

/in/database.c: In function 'dbLIST':
/in/database.c:173:27: warning: unused parameter 'db_command' [-Wunused-parameter]
 void dbLIST(Parsed_Tokens db_command) {
                           ^~~~~~~~~~
/in/database.c: In function 'dbUPDATE':
/in/database.c:237:75: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
             if (strcmp(course, current_table->assignments[j].course) == 0 &&
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                 strcmp(name, current_table->assignments[j].name) == 0 ||
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      
/in/database.c: In function 'dbDELETE':
/in/database.c:278:75: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
             if (strcmp(course, current_table->assignments[j].course) == 0 &&
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                 strcmp(name, current_table->assignments[j].name) == 0 ||
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      
/in/database.c:281:42: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 strcmp(course, "*") == 0 && strcmp(name, current_table->assignments[j].name) == 0 ||
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/database.c:282:42: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 strcmp(course, "*") == 0 && strcmp(name, "*") == 0) {
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/database.c: In function 'dbSELECT':
/in/database.c:317:75: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
             if (strcmp(course, current_table->assignments[j].course) == 0 && strcmp(name, "*") == 0 ||
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/database.c:320:83: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                     if (strcmp(course, current_table->assignments[m].course) == 0 && strcmp(name, "*") == 0 ||
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/database.c:340:79: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
             if (strcmp(course, current_table->assignments[count].course) == 0 && strcmp(name, "*") == 0 ||
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/database.c: In function 'execute':
/in/database.c:380:9: warning: implicit declaration of function 'strcasecmp'; did you mean 'strncmp'? [-Wimplicit-function-declaration]
     if (strcasecmp("EXIT", db_command.tokens[0]) == 0) {
         ^~~~~~~~~~
         strncmp
/in/database.c: In function 'main':
/in/database.c:415:9: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
         gets(user_input);
         ^~~~
         fgets
/in/database.c: In function 'dbSAVE':
/in/database.c:110:12: warning: 'current_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
     Table *current_table;
            ^~~~~~~~~~~~~
/in/database.c: In function 'dbPRINT':
/in/database.c:159:42: warning: 'current_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
         for (int i = 0; i < current_table->assignNum; i++) {
                             ~~~~~~~~~~~~~^~~~~~~~~~~
/in/database.c: In function 'dbINSERT':
/in/database.c:206:33: warning: 'current_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
         current_table->assignNum++;
         ~~~~~~~~~~~~~~~~~~~~~~~~^~
/in/database.c: In function 'dbUPDATE':
/in/database.c:241:21: warning: argument 1 null where non-null expected [-Wnonnull]
                 if (strcmp(field, "difficulty") == 0) {
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /in/database.c:2:0:
/usr/include/string.h:136:12: note: in a call to function 'strcmp' declared here
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/database.c:243:28: warning: argument 1 null where non-null expected [-Wnonnull]
                 } else if (strcmp(field, "deadline") == 0) {
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /in/database.c:2:0:
/usr/include/string.h:136:12: note: in a call to function 'strcmp' declared here
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/database.c:225:12: warning: 'old_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
     Table *old_table;
            ^~~~~~~~~
/in/database.c:224:12: warning: 'current_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
     Table *current_table;
            ^~~~~~~~~~~~~
/in/database.c: In function 'dbDELETE':
/in/database.c:284:41: warning: 'current_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
                 current_table->assignNum--;
                 ~~~~~~~~~~~~~~~~~~~~~~~~^~
/in/database.c: In function 'dbSELECT':
/in/database.c:322:29: warning: argument 1 null where non-null expected [-Wnonnull]
                         if (strcmp(field, "difficulty") == 0) {//descending
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /in/database.c:2:0:
/usr/include/string.h:136:12: note: in a call to function 'strcmp' declared here
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/database.c:328:36: warning: argument 1 null where non-null expected [-Wnonnull]
                         } else if (strcmp(field, "deadline") == 0) {//ascending
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /in/database.c:2:0:
/usr/include/string.h:136:12: note: in a call to function 'strcmp' declared here
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/database.c:344:24: warning: 'current_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
                        current_table->assignments[count].course,
                        ^~~~~~~~~~~~~
/tmp/cceQky3P.o: In function `main':
database.c:(.text.startup+0x36): warning: the `gets' function is dangerous and should not be used.
# Status Time Cost Memory Cost
#1 Runtime Error (-11) Detail 1ms 360.0 KiB
#2 Runtime Error (-11) Detail 1ms 328.0 KiB
#3 Runtime Error (-11) Detail 1ms 364.0 KiB
#4 Runtime Error (-11) Detail 1ms 368.0 KiB
#5 Runtime Error (-11) Detail 1ms 360.0 KiB

Information

Submit By
Type
Submission
Homework
Lab 5 (TEST ONLY) (+AUTO)
Language
C
Submit At
2021-11-14 14:51:08
Judged At
2021-11-21 15:06:38
Judged By
Score
0
Total Time
6ms
Peak Memory
368.0 KiB