[Development] clang warning

2014-03-22 Thread Kurt Pattyn
Hi,

when compiling an application, I get a lot of these warnings:

Qt5.3.0/5.3/clang_64/lib/QtGui.framework/Headers/qquaternion.h:145:12: warning: 
'qIsNull' was marked unused but
  was used [-Wused-but-marked-unused]
return qIsNull(xp)  qIsNull(yp)  qIsNull(zp)  qIsNull(wp);

Qt5.3.0/5.3/clang_64/lib/QtGui.framework/Headers/qquaternion.h:268:12: warning: 
'qFuzzyCompare' was marked unused
  but was used [-Wused-but-marked-unused]
return qFuzzyCompare(q1.xp, q2.xp) 

Does anybody has an idea what this means?

Cheers,

Kurt___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] clang warning

2014-03-22 Thread Thiago Macieira
Em sáb 22 mar 2014, às 12:39:40, Kurt Pattyn escreveu:
 Hi,
 
 when compiling an application, I get a lot of these warnings:
 
 Qt5.3.0/5.3/clang_64/lib/QtGui.framework/Headers/qquaternion.h:145:12:
 warning: 'qIsNull' was marked unused but was used
 [-Wused-but-marked-unused]
 return qIsNull(xp)  qIsNull(yp)  qIsNull(zp)  qIsNull(wp);
 
 Qt5.3.0/5.3/clang_64/lib/QtGui.framework/Headers/qquaternion.h:268:12:
 warning: 'qFuzzyCompare' was marked unused but was used
 [-Wused-but-marked-unused]
 return qFuzzyCompare(q1.xp, q2.xp) 
 
 Does anybody has an idea what this means?

It means the meaning of __attribute__((unused)) changed. The documentation I 
have for GCC 4.8 says:

 This attribute, attached to a function, means that the function is
 meant to be possibly unused.  GCC does not produce a warning for
 this function.

Note the possibly part in possibly unused. It means the function may still 
be used, but in most cases it won't be. We added the Q_DECL_UNUSED to the 
static inline functions of qglobal.h so the compiler wouldn't complain that we 
declared them static and did not use.

I don't see a point in implementing Clang's behaviour. If we know a static 
function is never used, we can remove it. The usefulness of the attribute is 
when we can't be certain, such as depending on ifdefs or functions declared in 
headers.

Please file a bug report against Clang.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development