dollar sign in macros

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben Pfaff

    #16
    Re: dollar sign in macros

    Random832 <random@random. yi.orgwrites:
    Is \u0024 allowed in identifiers?
    No. See C99 6.4.2.1:

    3 Each universal character name in an identifier shall designate
    a character whose encoding in ISO/IEC 10646 falls into one
    of the ranges specified in annex D.59)

    0024 isn't in the list in annex D.

    I posted the opposite answer earlier in this thread, but I was
    wrong. I was confused by 6.4.3, which specifically adds 0024 to
    the list of values allowed in a universal-character-name.
    Is there a list of what UCNs are and are not allowed in identifiers?
    Annex D in the standard gives a complete list.
    --
    "You call this a *C* question? What the hell are you smoking?" --Kaz

    Comment

    • av

      #17
      Re: dollar sign in macros

      On 4 Dec 2006 15:08:58 -0800, Spiros Bousbouras wrote:
      >As others have said $ is probably part of the name of
      >the variable and not allowed in standard C. Some compilers
      >allow as an extension $ to be part of an identifier name ;
      >for example gcc.
      it seems bcc32 too

      Comment

      • Kevin Handy

        #18
        Re: dollar sign in macros

        Mark McIntyre wrote:
        On 4 Dec 2006 14:03:55 -0800, in comp.lang.c , "Digital Puer"
        <digital_puer@h otmail.comwrote :
        >
        >
        >>I've inherited some code where the coder placed dollar signs in
        >>his preprocessor macros. What is the significance of the
        >>dollar signs ($) ?
        >
        >
        reminds me of the old VAX/VMS system routines/variables.
        VMS (not limited to just the vax version) uses the dollar
        sign in it's system routines as a seperator from the
        "service" and the function parts of the name. The names
        look something like (made up names) "sys$open", "str$compar e",
        "pascal$foobar" , etc.

        The dollar sign isn't really tied to system routines,
        you can actually use them in your own programs,
        but you take the chance of overlapping with some existing
        VMS variables/functions, so it's not really a good idea.

        ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
        http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
        ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

        Comment

        Working...