Joe Wein
Fighting spam and scams
on the Internet

Home / Blog / About us
Spam
419/Nigeria
Online fraud
jwSpamSpy
Contact

Email Spam Filter:
jwSpamSpy
Try it for free!

Google
 

GCC: unknown escape sequence: '\040'

Problem: While compiling C or C++ source code in the GNU C compiler you get a warning:

unknown escape sequence: '\040'

Explanation:
The octal code 040 is 0x20 which is the ASCII code for space. Your source code contains an illegal escape sequence in a string literal, a blackslash followed by a space. Unlike sequences such as \r, \r, \t, \', \" and \\ this is an invalid combination.

Solution:
If you meant to include a backslash followed by a space, for example when specifying a file name that includes a space:

char szFileName[] = { "Some\ File.jpg" };
                           ^
                           +--- this is illegal!
then you will need to double the backslash for it to be interpreted as a standalone character separate from the following space:
char szFileName[] = { "Some\\ File.jpg" };