lastfm / lastfm-desktop

The official Last.fm desktop application suite
http://www.last.fm
GNU General Public License v3.0
461 stars 94 forks source link

Compilation error due to disallowed pointer arith #63

Open AMDmi3 opened 6 years ago

AMDmi3 commented 6 years ago
Application.cpp:433:25: error: ordered comparison between pointer and zero ('void *' and 'int')                                                                                                                                                                      
    if( m_raiseHotKeyId >= 0 )                                                                                                                                                                                                                                       
        ~~~~~~~~~~~~~~~ ^  ~                                                                                                                                                                                                                                         
1 error generated.                                                                                                                                                                                                                                                   

The actual problem is that (void*)-1 is used as a magic value to denote (an unassigned?) key.

Application::Application(int& argc, char** argv) 
    :unicorn::Application( "fm.last.Scrobbler", argc, argv )
    , m_raiseHotKeyId( (void*)-1 )

I'd guess that itself is an undefined bahavior.