Why does the '$' character generate a warning?
Using the '$' character with CrossWorks for MSP430 (2.0.8) causes the following error: "literal contains non-portable characters".
Sure, I could ignore or work around the error. But this has me curious: why is this perfectly-good ASCII character considered non-portable? Is it because it can be interpreted as currency symbol? Non-portable between what?
Puzzled.
~Todd
-
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.
Please sign in to leave a comment.
Comments
4 comments