[Development] check, Mate!

Stephen Kelly stephen.kelly at kdab.com
Mon Jan 9 19:00:05 CET 2012


On Monday, January 09, 2012 18:00:29 Gábor Lehel wrote:
> 2012/1/9 Gábor Lehel <illissius at gmail.com>:
> > Perhaps we could use GCC's poison pragma[1] to make sure that no one
> > uses them? In some cases it would just be replacing one error message
> > with another (though perhaps a more user-friendly one), but in other
> > cases it would substitute an error for no error. Of course, it only
> > works with GCC. (TBF I haven't checked any other compilers.)
> > 
> > [1] http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html
> 
> ...though that would also poison them for user code which I'm not sure
> we want, so I suppose you would only want to turn it on when building
> Qt itself.

I think this is a good idea. It doesn't matter that it only works with GCC. If 
any platform fails, the CI gate does not open for the patch.

There's a few more instances of 'check' in Qt, after clearing those up, I 
could write a patch to add the pragma to qglobal which user code could enable 
if desired (just like QT_STRICT_ITERATORS or QT_NO_KEYWORDS for example).

#ifdef QT_CHECK_MACRO_CONFLICTS
#pragma GCC poison check <others...>
#endif

Any suggestions for an alternative name to QT_CHECK_MACRO_CONFLICTS ? Simply 
'check' perhaps :) ?

Thanks,

-- 
Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120109/412125da/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120109/412125da/attachment.sig>


More information about the Development mailing list