From: Date: July 20 2006 5:13pm Subject: Question about macro for __attribute__ in include/my_global.h List-Archive: http://lists.mysql.com/internals/33741 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1985_32669476.1153408398995" ------=_Part_1985_32669476.1153408398995 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline There is a macro in my_global.h that defines __attribute__ to be a no-op when gcc is used. '__cplusplus' is defined when gcc3.2 and gcc3.4 are used to compile MySQL on Linux. The result of this is that the many uses of __attribute__ are not available, including type-checking the format args to printf (and printf-like) statements. This is the macro in 4.0.26 and 5.1.11. Is this definition correct? #if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8) #define __attribute__(A) #endif If the macro were defined as this, then it would not be a no-op for gcc versions >= 3.4 #if !defined(__attribute__) && \ (!defined(__GNUC__) || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || \ (defined(__cplusplus) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ < 4))) #define __attribute__(A) #endif ------=_Part_1985_32669476.1153408398995--