Created attachment 48308 [details] Use __attribute__ only with gcc __attribute__ only works with gcc, fix attached.
Attachment 48308 [details] did not pass style-queue: Failed to run "['git', 'reset', '--hard', 'HEAD']" exit_code: 128 fatal: Unable to create '.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue. fatal: Could not reset index file to revision 'HEAD'. If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 48308 [details] Use __attribute__ only with gcc > +#ifdef __GNUC__ > +#define __attribute__(x) __attribute__(x) > +#else > +#define __attribute__(x) > +#endif Since this is Qt code, how about using Q_CC_GNU?
Created attachment 48314 [details] Use Q_CC_GNU instead of __GNUC__
(In reply to comment #2) > (From update of attachment 48308 [details]) > > +#ifdef __GNUC__ > > +#define __attribute__(x) __attribute__(x) > > +#else > > +#define __attribute__(x) > > +#endif > > Since this is Qt code, how about using Q_CC_GNU? Done :)
I guess we don't need #define for GCC? I think #ifndef Q_CC_GNU #define __attribute__(x) #endif should work.
Created attachment 48315 [details] Simplify the ifdef, handle the non-gcc case only
(In reply to comment #5) > I guess we don't need #define for GCC? I think > > #ifndef Q_CC_GNU > #define __attribute__(x) > #endif > > should work. Good catch, done. Thanks.
This LGTM as a build-fix. Few minor comments: noreturn attribute can be defined for other compilers as well not just for GCC - the syntax for MSVC is "__declspec(noreturn)". A better solution would be: #if defined(__GNUC__) // or Q_CC_GNU #define NO_RETURN __attribute__ ((noreturn)) #elif defined(_MSC_VER) // or the Q_ equivalent #define NO_RETURN __declspec(noreturn) #else #define NO_RETURN #endif I would also put this section in the beginning of utils.h right after the #include statement.
Comment on attachment 48315 [details] Simplify the ifdef, handle the non-gcc case only Already fixed by Tor Arne in yrunk
Already fixed by someone else on trunk.