Home > Net >  Double Dollar sign in C Program
Double Dollar sign in C Program

Time:08-11

I found in some Arm reference software, in the file, "arch/arm/armv7-m/src/arch_exceptions.c," the following lines:

#ifdef __ARMCC_VERSION 
extern char Image$$ARM_LIB_STACKHEAP$$ZI$$Limit;
           
#    define arch_exception_stack (&Image$$ARM_LIB_STACKHEAP$$ZI$$Limit)
#else
extern char __stackheap_end__;

#    define arch_exception_stack (&__stackheap_end__)
#endif

I know ## is used for string concatenation but I've never seen this double $$ sign. Not knowing what that is, I can't search for the right term.

How is this $$ used in C?

CodePudding user response:

Whether or not those $$ 'field-separators' have any specific meaning to the target assembler and/or linker, I can't say, but the GNU C compiler does allow dollar signs in identifier names.

So, presumably, Image$$ARM_LIB_STACKHEAP$$ZI$$Limit is the name of an extern char variable defined in one of the support libraries for the Arm platform.

  •  Tags:  
  • c gcc
  • Related