MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Mark Callaghan Date:July 20 2006 3:13pm
Subject:Question about macro for __attribute__ in include/my_global.h
View as plain text  
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

Thread
Question about macro for __attribute__ in include/my_global.hMark Callaghan20 Jul
  • Re: Question about macro for __attribute__ in include/my_global.hMarc Alff20 Jul
    • Re: Question about macro for __attribute__ in include/my_global.hMark Callaghan20 Jul