I program on a Mac, and one of the most frequent compiler errors I get is the following:
src/cpp/scd/SelSCAN.cpp:122:2: error: stray '\240' in program
src/cpp/scd/SelSCAN.cpp:126:4: error: stray '\302' in program
This occurs apparently sometimes when I type the {
and |
special characters. If I retype these characters carefully, the error disappears, but if I type fast it happens to me all the time. Maybe I hit a combination of keys that produces this, though I do not really know what my fingers do. They have a mind of their own and work too fast for me to check. I can't switch it off mentally/physically, so I wonder if there is a way to avoid this technically. What are these strange stray invisible characters anyway?
This happens with both Sublime Text and Atom.
PS: I am using a QWERTZ, (i.e. German) keyboard layout, in case it matters.
They are a non-breaking space
(\240) and a capital A with circumflex accent
(\302), I believe.
This may help you disable them... here
The keystroke for capital A with circumflex
is Option+E, release, shift A.
If you can't disable them, you can maybe run this to remove them:
tr -d '\240\302' < yourfile
or this, to remove them and replace your existing file if it is successful
tr -d '\240\302' < yourfile > $$.tmp && mv $$.tmp yourfile