Closed crclark96 closed 6 years ago
Hey,
Thanks, glad you are enjoying the book. Did you make the new struct definition exactly as it appears in the book and still get the error?
typedef struct lval {
int type;
long num;
/* Error and Symbol types have some string data */
char* err;
char* sym;
/* Count and Pointer to a list of "lval*" */
int count;
struct lval** cell;
} lval;
I'm wondering if this is some new kind of default behavior in clang...
I tried to reproduce the error and I think I had neglected to name the struct before naming the type (like so:
typedef struct {
int type;
long num;
/* Error and Symbol types have some string data */
char* err;
char* sym;
/* Count and Pointer to a list of "lval*" */
int count;
struct lval** cell;
} lval;
)
my mistake there! thanks for the response though
loving the book
when i was reformatting in chapter nine and added the line
struct lval** cell
to the struct definition, my version of clang [Apple LLVM version 9.1.0 (clang-902.0.39.1)] threw a bunch of warnings and the following error:and this note:
which led me to believe that line of the struct definition was being parsed as its own struct definition.
i fixed this by changing the definition and forward declaring the struct like so: