Review Request: static_casts for dom

Simon St James kdedevel at etotheipiplusone.com
Thu Oct 29 08:48:12 GMT 2009


Hi!

On Thursday 29 October 2009 08:18:25 Esben Mose Hansen wrote:
> On Wednesday 28 October 2009 23:00:58 Simon St James wrote:
> > I'm not sure if you hunted these down manually, but I have a locally
> >  patched  GDB that warns on all C-style cast, and gives a breakdown of
> > how they are interpreted (static_cast, static_cast from base to derived
> > [pointer/ reference], reinterpret_cast, const_cast etc).  Is there any
> > interest in having a list of all of these for some KDE modules at all?
>
> I would love to get that for Klipper. Should be a quick run!

Ugh - on further testing, fairly "safe" and unobjectionable expressions like

KIcon("icon-name")

are classed as C-style casts, so this is considerably less useful than I had 
thought :(

Nevertheless, I've attached the log anyway :)

Note that interfacing with C libraries (such as the X libraries) pretty much 
requires a few reinterpret_cast's here and there.

Si
-------------- next part --------------
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:110: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:112: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:114: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:119: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:121: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:125: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:127: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:129: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:30: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:34: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:37: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:39: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:41: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:43: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:45: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:47: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:49: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:52: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:54: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:56: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:58: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:61: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:63: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:66: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:68: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:70: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:72: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:74: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:76: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:79: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:81: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:83: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:85: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/klippersettings.cpp:87: warning: C-style cast to ‘QLatin1String’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/ui_actionsconfig.h:110: warning: C-style cast to ‘void’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/ui_editactiondialog.h:185: warning: C-style cast to ‘void’ (interpreted as static_cast)
/home/kde4daily/build/kdebase/workspace/klipper/ui_generalconfig.h:158: warning: C-style cast to ‘void’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/actionstreewidget.cpp:50: warning: C-style cast to ‘void’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipboardpoll.cpp:120: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipboardpoll.cpp:123: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipboardpoll.cpp:154: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipboardpoll.cpp:201: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipboardpoll.cpp:202: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipboardpoll.cpp:91: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/clipcommandprocess.cpp:46: warning: C-style cast to ‘QChar’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/configdialog.cpp:137: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/configdialog.cpp:54: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/configdialog.cpp:55: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/configdialog.cpp:56: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/configdialog.cpp:57: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/editactiondialog.cpp:191: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/editactiondialog.cpp:270: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/editactiondialog.cpp:271: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/editactiondialog.cpp:35: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/editactiondialog.cpp:37: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/editactiondialog.cpp:39: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/history.cpp:43: warning: C-style cast to ‘QListIterator<const HistoryItem*>’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/historyimageitem.cpp:34: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/historyimageitem.cpp:45: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/historystringitem.cpp:30: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/historyurlitem.cpp:32: warning: C-style cast to ‘int’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/historyurlitem.cpp:32: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/historyurlitem.cpp:42: warning: C-style cast to ‘QByteArray’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:143: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:148: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:153: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:186: warning: C-style cast to ‘KShortcut’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:191: warning: C-style cast to ‘KShortcut’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:195: warning: C-style cast to ‘KShortcut’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:520: warning: C-style cast to ‘KGuiItem’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:521: warning: C-style cast to ‘KGuiItem’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipper.cpp:971: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipperpopup.cpp:134: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/klipperpopup.cpp:150: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/popupproxy.cpp:107: warning: C-style cast to ‘QIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/popupproxy.cpp:132: warning: C-style cast to ‘QFontMetrics’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:211: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:228: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:246: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:250: warning: C-style cast to ‘KIcon’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:355: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:368: warning: C-style cast to ‘QString’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:393: warning: C-style cast to ‘<anonymous struct>*’ (interpreted as reinterpret_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:394: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:397: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:398: warning: C-style cast to ‘Window*’ (interpreted as reinterpret_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:406: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:409: warning: C-style cast to ‘Atom’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:410: warning: C-style cast to ‘const char*’ (interpreted as reinterpret_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:479: warning: C-style cast to ‘QVariant’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.cpp:494: warning: C-style cast to ‘QVariant’ (interpreted as static_cast)
/home/kde4daily/src/kdebase/workspace/klipper/urlgrabber.h:148: warning: C-style cast to ‘QRegExp’ (interpreted as static_cast)


More information about the kde-core-devel mailing list