LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

Rep: Reputation: 0
error-messages from gcc


Hello,

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
clean:
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 comptechdoc.org (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 DATABITS;
long STOPBITS;
long PARITYON;
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
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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
emathias
LQ Newbie
 
Registered: Oct 2004
Distribution: Gentoo
Posts: 24

Rep: Reputation: 15
Hi,

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
stewag
LQ Newbie
 
Registered: Oct 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Hello,

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
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:33 AM.

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