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: patch: don't issue -Wreorder warnings when order doesn't matter


On Fri, Jul 29, 2011 at 11:53:08AM +0200, Richard Guenther wrote:
> 2011/7/29 Daniel Marjamäki <daniel.marjamaki@gmail.com>:
> Why doesn't it matter in this case but it matters when the initializer
> are non-constant?

Plus the documentation of -Wreorder even uses constants:

`-Wreorder (C++ and Objective-C++ only)'
     Warn when the order of member initializers given in the code does
     not match the order in which they must be executed.  For instance:

          struct A {
            int i;
            int j;
            A(): j (0), i (1) { }
          };

     The compiler will rearrange the member initializers for `i' and
     `j' to match the declaration order of the members, emitting a
     warning to that effect.  This warning is enabled by `-Wall'.

If you don't want to fix up your code, just compile it with -Wno-reorder.

	Jakub


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