Helping help50
Recall that help50
is a command-line tool that translates other tools' error messages into user-friendlier messages, much like CS50’s staff might do verbally at office hours. Built into help50
are lots of "regular expressions," patterns of text defined by the staff for which help50
looks when passed other tools' output as input. If help50
recognizes a pattern in some tool’s output, it responds with the staff’s advice for that error.
But help50
doesn’t recognize all error messages (yet)! Indeed, each of the error messages below was experienced by one or more classmates, but was unrecognized by help50
. For each of these error messages, how should help50
have responded? A friendly one- or two-sentence note for each should suffice. Even if you’ve not experienced some error message yourself, infer from the context provided (by clang
in these cases) what it might mean.
Answer in help50.md
.
Questions
-
(2 points.) From Problem Set 1:
cash.c:11:15: error: invalid operands to binary expression ('float' and 'float') n = n % 100; ~ ^ ~~~
-
(2 points.) From Problem Set 2:
caesar.c:16:16: error: incompatible pointer types initializing 'string' (aka 'char *') with an expression of type 'string (void)' [-Werror,-Wincompatible-pointer-types] string input = get_string; ^ ~~~~~~~~~~
-
(2 points.) From Problem Set 4:
recover.c:31:23: error: comparison of constant 255 with expression of type 'char' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (buffer[0] == 0xff && ~~~~~~~~~ ^ ~~~~
-
(2 points.) From Problem Set 5:
dictionary.c:15:22: error: excess elements in scalar initializer [-Werror] node *root = {false, {NULL}}; ^~~~~~
Debrief
-
Which resources, if any, did you find helpful in answering this problem’s questions?
-
About how long did you spend on this problem’s questions?