Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-23-2004, 12:09 PM   #1
LQ Newbie
Registered: Oct 2004
Posts: 2

Rep: Reputation: 0
error-messages from gcc


I wanted to compile a terminal-program for the serial port.

But I got a number of error-messages.
Perhaps somebody can help me.

This is the Makefile I used:

terminal: terminal.c
gcc -ggdb terminal.c -o terminal
rm -f *.o

Here are the error-messages

terminal.c: in function `main`
terminal.c:95:20 invalid suffix "Parm_Count" on integer constant
terminal.c:277: error: stray `\311` in program
terminal.c:277: error: stray `\254` in program
terminal.c:277: error: stray `\341` in program
terminal.c:277: error: stray `\220` in program

Unfortunately I don`t understand the numbers: 95:20, 277.
Parm_Count is used as an argument of main( ). The Line has the number 34 and not 95.
The characters \311, \254, etc. don`t appear in the program.

Here are a few lines:
The program comes from (linux_pgcserial.html).

#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <sys/types.h>

#define BAUDRATE B38400
#define MODEMDEVICE "/dev/ttyS1"
#define _POSIX_SOURCE 1 //POSIX compliant source
#define FALSE 0
#define TRUE 1

volatile int STOP=FALSE;

void signal_handler_IO (int status); //definition of signal handler
int wait_flag=TRUE; //TRUE while no signal received
char devicename[80];
long Baud_Rate = 38400; // default Baud Rate (110 through 38400)
long BAUD; // derived baud rate from command line
long PARITY;
int Data_Bits = 8; // Number of data bits
int Stop_Bits = 1; // Number of stop bits
int Parity = 0; // Parity as follows:
// 00 = NONE, 01 = Odd, 02 = Even, 03 = Mark, 04 = Space
int Format = 4;
FILE *input;
FILE *output;
int status;

main(int Parm_Count, char *Parms[])
char version[80] = " POSIX compliant Communications test program version 1.00 4-25-1999\r\n";
char version1[80] = " Copyright(C) Mark Zehner/Peter Baumann 1999\r\n";
char version2[80] = " This code is based on a DOS based t
Old 10-23-2004, 05:34 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,707

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
The piece of code you sent compiles with no error with gcc.

What editor are you using ? it looks like your file is corrupted or has some formatting embedded.
Old 10-25-2004, 02:37 AM   #3
LQ Newbie
Registered: Oct 2004
Distribution: Gentoo
Posts: 24

Rep: Reputation: 15

Once i get an error like this when using nedit editor...
try to open it on vi or emacs that these unknowns characters will probably appear...
Old 10-25-2004, 12:38 PM   #4
LQ Newbie
Registered: Oct 2004
Posts: 2

Original Poster
Rep: Reputation: 0

thank you for your help! Because you told me that it should work, I looked again at the source.
I found that the error! The line that caused the error was:
"for (i=1; i&#60Parm_Count; i++)"

Greetings from stewag


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
error messages ust Linux - Software 1 11-12-2005 01:20 AM
in gcc compiler error: parse error before string constsnt cynthia_thomas Linux - Networking 1 10-20-2005 01:29 AM
Error messages ust Linux - Software 5 07-18-2005 10:31 AM
From where am i getting error messages to /var/log/messages? prabhuacsp Programming 3 02-16-2005 08:59 AM
From where am i getting error messages to /var/log/messages? prabhuacsp Linux - Networking 1 02-16-2005 12:34 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration