Thread: Stray octal 127? Waaaaaaaaa?

  1. #1
    Registered User Terran's Avatar
    Join Date
    May 2008
    Location
    Nashua, NH
    Posts
    100

    Stray octal 127? Waaaaaaaaa?

    I added some code, and i got
    Code:
    C:\Users\Matt\Desktop\Projects\fincal2\fincal2Main.cpp|219|error: stray '\127' in program|
    so i commented it all out, but i still get it, what's going on? What does that even mean!?
    Sorry, but i'm a Code::Blocks man now.

  2. #2
    Registered User Terran's Avatar
    Join Date
    May 2008
    Location
    Nashua, NH
    Posts
    100
    anybody?
    Sorry, but i'm a Code::Blocks man now.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Did you by any chance copied and pasted the file through a terminal? I got the same problem when I copied my code through putty (ssh client for windows). No idea why. I just stopped doing it.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    One common way is to copy/paste HTML code into your editor.

    Anyway, look very carefully at the indicated line. Delete any space and replace it with a real space (for example). Also look for " " marks which slope in either direction.
    A hex editor is ideal for this, as any source code should contain only 0x20 to 0x7E + 0x09 (tab) 0x0a (linefeed) or 0x0d (newline)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I think there's a bug in that error message! \127 (octal) is 87 decimal - so a W.

    I suspect it's actually referring to a "delete" character, ascii decimal 127.

    Otherwise the above comments are correct - use hex editor or some editor that can display "funny" characters. (emacs is quite capable of this for example).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 04-29-2017, 02:11 AM
  2. stray errors
    By Sowmia in forum C Programming
    Replies: 3
    Last Post: 07-13-2011, 10:23 AM
  3. stray '@' in program
    By hilbert16 in forum C++ Programming
    Replies: 2
    Last Post: 10-05-2010, 06:21 AM
  4. stray characters...
    By vapanchamukhi in forum C Programming
    Replies: 3
    Last Post: 09-22-2008, 04:43 AM
  5. stray octal 0223 in program
    By reRanger in forum C++ Programming
    Replies: 3
    Last Post: 11-23-2004, 02:45 AM