At the end of lecture 85, the compiler outputs this warning message:
./parser.c:109:39: warning: 'memset' call operates on objects of type 'struct parser_history_switch' while the size is based on a different type 'struct parser_history_switch *' [-Wsizeof-pointer-memaccess]
memset(&history->_switch, 0, sizeof(&history->_switch));
~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~
./parser.c:109:39: note: did you mean to remove the addressof in the argument to 'sizeof' (and multiply it by the number of elements)?
memset(&history->_switch, 0, sizeof(&history->_switch));
To fix the issue, I changed the line from:
memset(&history->_switch, 0, sizeof(&history->_switch));
to:
memset(&history->_switch, 0, sizeof(history->_switch));