List:Commits« Previous MessageNext Message »
From:Kevin Lewis Date:November 18 2010 3:39pm
Subject:Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)
View as plain text  
On 2010/11/18 1:56 AM, Marko Mäkelä wrote:
> On Thu, Nov 18, 2010 at 05:11:06AM -0000, kevin.lewis@stripped wrote:
>> +
>> +#define CREATE_OPTION_MESSAGE(_text_, _parm_) {    \
>> +    push_warning_printf(    \
>> +        thd, MYSQL_ERROR::WARN_LEVEL_WARN,    \
>> +        ER_ILLEGAL_HA_CREATE_OPTION,    \
>> +        _text_, _parm_);    \
>> +}
>
> Never use identifiers that start with an underscore.
OK, I will not add '_' before or after variables within macros since it 
does not seem that InnoDB code uses that convention.

Most of the code I have worked on in the past used extra '-' before 
macro variables and sometimes after.  Older preprocessors did not 
enforce the scope of those variables.  They used to let all variables 
take on the scope of the code they happen to be dropped into.

Well I did some testing, and it seems that variables in preprocessed 
function-type-macros have only the scope of those macros at least since 
VS2005.  So for the last 5 years, at least, Windows code could use 
variable names in macros just like in functions.  I'm not sure about 
gcc, but at least I know that i686-apple-darwin9-gcc-4.0.1 enforces the 
scope of macro variables.

Currently, mysql-5.5 cannot even be built on VS2005 because of types not 
known to VS2005 like CONDITION_VARIABLE and SRWLOCK.  (See bug56146).  
So it seems we are not looking back, which is fine with me.

Macro variables have scope these days, so let's treat them as function 
variables.

Thread
bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222) kevin.lewis18 Nov
  • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Vasil Dimov18 Nov
    • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Kevin Lewis18 Nov
    • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Kevin Lewis18 Nov
  • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Marko Mäkelä18 Nov
    • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Kevin Lewis18 Nov
      • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Calvin Sun18 Nov
      • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Marko Mäkelä18 Nov
        • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Sunny Bains18 Nov
          • RE: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Vladislav Vaintroub18 Nov
          • RE: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Vladislav Vaintroub18 Nov
          • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Sergei Golubchik18 Nov
          • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Marko Mäkelä22 Nov
          • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Marko Mäkelä22 Nov
        • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Sunny Bains18 Nov
      • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Marko Mäkelä18 Nov
      • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Calvin Sun18 Nov
    • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Kevin Lewis18 Nov
  • Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)Marko Mäkelä18 Nov