
Increase your warning tolerance. See: http://stackoverflow.com/questions/1067827/dangerous-ways-of-removing-compil... Regards. Allen Cronce wrote:
Hi all,
When building with boost 1.36 and GCC 4.2 under Xcode, the following code produces a warning:
boost::array
warningArray = { 1, 2 }; warning: missing braces around initializer for 'int [2]'
We see no warnings with GCG 4.0. We have a zero warning tolerance. All warnings are counted as errors.
The boost::array documentation indicates that the single brace approach should work for conforming compilers, according to 8.5.1 (11) of the Standard. So does that mean that GCC 4.2 is non-conforming?
Sure enough, when I change the code to include a second set of braces, the warning is gone:
boost::array
noWarningArray = { { 1, 2 } }; But this is a problem as we move to GCC 4.2 because a) we use initialized arrays all over the place, so this means a lot of little changes, and b) requiring an extra set of braces is counter intuitive and irritating at best.
I don't like the idea of making the above code changes, and I don't want to globally disable the warning because it might be useful for other code. Does anyone have a better solution?
Thanks in advance for any suggestions.
Best, -- Allen Cronce
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users