This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Suppressing specific compiler warnings


On May 26, 2004, at 1:15 PM, Zack Weinberg wrote:
Dale Johannesen <dalej@apple.com> writes:
Another compiler I worked on did simple pattern matching:

-Wno="uninit"

to suppress the English uninitialized-variable warning, for example.
Some people see this as inelegant, but it's trivial to implement and
maintain, coexists nicely with i18n, is convenient for users, and
would simplify the compiler internals: just go ahead and call
'warning' and let the low level routine do the pattern match.

I'm fond of this idea myself. We've already got a regex engine to hand. We could even convert all the existing warn_* flags to canned sets of patterns to suppress, except that (a) that will break if someone decides to reword a message, and (b) some warnings involve doing expensive calculations to decide if they're appropriate.

I don't see how it coexists nicely with i18n, though.  Do we match
against the message before translation (user unfriendly) or after
(code/makefiles suddenly dependent on locale)?

I was thinking after, but you're right that makefiles would be a problem.
How about both?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]