On 31/05/07, Jakub Jelinek <[EMAIL PROTECTED]> wrote:
On Wed, May 30, 2007 at 09:23:34PM -0400, Diego Novillo wrote: > On 5/30/07 7:07 PM, Joe Buck wrote: > > > How about: have -Wall still set warn_strict_overflow > > to 1, but to have -Wall -Wstrict-overflow *or* -Wstrict-overflow -Wall > > *or* just -Wstrict-overflow set it to 2? The only change would be > > to prevent -Wall from *decreasing* the value. > > Yes. My idea was along similar lines. Given an umbrella option like > -Wall or -Ox, it should only set specific options iff those options are > not present in the command line. > > That means that we have to have presence bits for each option.Or evaluate first the group options (-W{,no}-all, -Wextra, -O{,0,1,2,3,s}) and then all other options.
That was what I was planning to do. We would also need to keep a default value somewhere. Currently we initialise variables with default values and we assign that value to -1 if we want to detect uninitialisated variables. My proposal would be: * Init all values to -1 * Handle command-line options into flags. Group options have their own flag and don't touch the others. * Handle group options: if the simple variable is still -1, then assign the value of the group option. * If the variable is still -1, assign the default value that corresponds to the Init(value) in *.opt files. A missing Init(value) would be assumed to mean Init(0). Cheers, Manuel
