FIAS . Impressum . Privacy

"suggest parentheses around && within ||" with gcc 4.3.2

Matthias Kretz [please enable javascript to see the address]
Thu Aug 15 19:03:35 CEST 2013


Best workaround is to use the provided cmake scripts from Vc. Best fix is to 
use a newer GCC. Here's the "logic" for this warning:

if(Vc_GCC_VERSION VERSION_LESS 4.5.0)
  UserWarning("GCC 4.4.x shows false positives for -Wparentheses, thus we 
rather disable the warning.")
  string(REPLACE " -Wparentheses " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  string(REPLACE " -Wparentheses " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -Wno-parentheses")

  UserWarning("GCC 4.4.x shows false positives for -Wstrict-aliasing, thus we 
rather disable the warning. Use a newer GCC for better warnings.")
  AddCompilerFlag("-Wno-strict-aliasing")

  UserWarning("GCC 4.4.x shows false positives for -Wuninitialized, thus we 
rather disable the warning. Use a newer GCC for better warnings.")
  AddCompilerFlag("-Wno-uninitialized")

I searched for a workaround in Vc for a long time. But GCC < 4.5 is simply 
broken and there seems to be no other way than to disable the warning 
altogether.

Cheers,
  Matthias

On Thursday 15 August 2013 16:58:58 Kulakov, Igor wrote:
> Hi Matthias,
> 
> 
> Under certain conditions (compiling Vc-0.7.2 without cmake, with gcc 4.3.2)
> I get thousands warnings like this:
> 
> /Vc/scalar/../common/operators.h: In function 'typename
> Vc::<unnamed>::EnableIf<(((Vc::Scalar::<unnamed>::IsVectorOperands::Value
> || (((Vc::<unnamed>::IsLikeSignedInteger::Value && (!
> Vc::<unnamed>::IsEqualType::Value)) &&
> Vc::<unnamed>::HasImplicitCast::Value) && (!
> Vc::<unnamed>::HasImplicitCast::Value))) ||
> (((Vc::<unnamed>::IsLikeSignedInteger::Value && (!
> Vc::<unnamed>::IsEqualType::Value)) &&
> Vc::<unnamed>::HasImplicitCast::Value) && (!
> Vc::<unnamed>::HasImplicitCast::Value))) || false), Vc::Scalar::Mask<1u>
> >::Value Vc::Scalar::operator<=(const T0&, const T1&)':
> /include/Vc/scalar/../common/operators.h:197: warning: suggest parentheses
> around && within ||
> 
> operators.h looks ok for me... but could you recheck or suggest other
> possible reasons to get such warnings, please?
> 
> 
> Thank you,
> Igor
-- 
Dipl.-Phys. Matthias Kretz

Web:   http://compeng.uni-frankfurt.de/?mkretz

SIMD easy and portable: http://compeng.uni-frankfurt.de/?vc



More information about the Vc-devel mailing list
FIAS . Impressum . Privacy