This is the first step for this project, due now:
http://gcc.gnu.org/wiki/Warning%20Message%20Control
This patch is a mostly mechanical patch that causes one fundamental
change: the warning() function now takes a numeric parameter that will
later be used to control that warning. For now, all such calls pass 0
(zero) for this parameter.
As per the project page, this is the step that is most risky, as there
may be calls to warning() that weren't detected. The fix is going to
be one of two changes: First, pass 0 as the first parameter to warning
(), or switch to calling warning0 (). warning0() has the same
signature as error() and pedwarn() for cases where you store a pointer
to one of those functions, rather than calling warning() directly.