http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59304

--- Comment #2 from DJ Delorie <dj at redhat dot com> ---
The diagnostic changes that happen with #pragmas are stored in a linear array,
which corresponds (somehow) to the linear input source file representation. 
So, given a location in the source, we can find the spot in the array that
corresponds to the state at that point, with earlier array entries being
"before" that location, and later ones being "after".

Once found, we scan backwards through the array looking for #pragmas that might
affect the diagnostic.  If we see one, that's what we use.  If we see a DK_POP
code, we skip over the chunk of the array to the matching PUSH ([i].option),
i.e. it's as if those actions never happened.

What's supposed to happen is that changing a diagnostic via a #pragma should
push a change code onto that stack also, this should happen via a call to
diagnostic_classify_diagnostic when the #pragma changes the handling (with
WHERE set to a known location).

Reply via email to