Why does the '$' character generate a warning?

Comments

4 comments

  • Avatar
    Steve

    I get the same error with #s and other symbols. I can get rid of all warnings apart from these!

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    Could you provide an example of the code causing the error?

    0
    Comment actions Permalink
  • Avatar
    Steve

    case '$':   keyBuf=K_SECRET;      

    case '@':   keyBuf=K_PC;

    "médico:",

    "ÈEŠTINA",

    "FRANÇAIS",

    #s were OK after all - I just assumed that they cause an error because of their association with the $s!

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    See section 5.2.1 "Character Sets" of the C90 standard.  '$' and '@' are not members of the basic character set and, hence, are not portable characters.  This is because the '$' in the ASCII code page can be substituted in other code pages.  '#' is in the basic character set and does not generate a warning in strings.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.