Reading GCC error messages
Every GCC diagnostic has the same shape: scratch.c:3:13: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 3 | char *s = "scratching surface"; | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Line 1: file:line:col: severity: message [flag] scratch.c:3:13: where. Columns start at 1. Most terminals/editors make this clickable. severity: error stops the build; warning doesn’t; note: adds context to the diagnostic above it. [-Werror=discarded-qualifiers]: the flag that controls this check. -Werror= means it’s really the warning -Wdiscarded-qualifiers, promoted to an error by -Werror. Search man gcc for /Wdiscarded-qualifiers. -Wno-<name> disables it, which is rarely the right fix. The message has a fixed vocabulary The first words say where in the code the problem is: ...