tags:

views:

181

answers:

3
+1  Q: 

YACC compile error

I am compiling a YACC file using Cygwin shell on a PC. I am getting an 'unknown character \15'. The weird thing is that a co-worker on another machine can compile the exact same file using the same shell with no warnings or errors. Is there some kind of flag I need to set in my shell or with the compiler? We are using nmake and a Visual Studio compiler. I will be happy to provide more info if needed.

Thank you very much!

+3  A: 

Check your end-of-line settings. You probably have CRLF and YACC expects LF only. CR is ASCII 13 (15 in octal).

laalto
I ran DOS->UNIX on the file and it worked. Thanks!
A: 

Octal 15 is a carriage return. Did you transfer the file in text mode from your coworker's machine?

Dave
+1  A: 

When you install cygwin you get asked about what the default EOL (end of line) should be, traditional unix "\n" or traditional dos "\r\n". My guess is that you and your co-worker have cygwin configured differently. You probably want to run your setup.exe again and select dos EOL.

hlovdal
Or, more likely, select non-DOS (Unix) line endings, since the complaint is about ^M being present.
Jonathan Leffler
My expectations was that yacc then maybe would accecpt carriage returns in the source without complaining. But of course fixing the source is the most reliable thing to do.
hlovdal