List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:November 18 2010 9:12pm
Subject:Re: bzr commit into mysql-5.5-innodb branch (kevin.lewis:3222)
View as plain text  
Kevin,

On 19/11/2010, at 6:30 AM, Marko Mäkelä <marko.makela@stripped>  
wrote:

> On Thu, Nov 18, 2010 at 09:39:15AM -0600, Kevin Lewis wrote:
>> 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.
>
> I am not aware of such preprocessors, and I have used various C  
> development environments since 1991 or so.
>
> Could you be thinking of variables that are introduced in the macro  
> expansion? There are a few such variables in the InnoDB code base,  
> in some data structure iterators. Heikki has used the 313 suffix for  
> them, and the <valgrind/memcheck.h> uses the _qzz prefix, probably  
> because it must try harder to avoid clashes.
>
> Some 10 years ago, I wrote a translator that generated C code. I  
> used the i prefix for some generated functions, which turned out to  
> be a bad idea: i386 was a reserved symbol in the default GCC  
> configuration.
>
>    Marko

I'm not sure which variables you are referring to. To establish  
context, the preprocessor is simply  a text processor like m4. The  
scope of any C variable however is determinded by the rules of the C  
language. _ prefixed variables are reserved for library writers IIRC  
and should be avoided.
I don't have my C99 standard at hand to quote chapter and verse.

Regards,
-sunny
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