473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

very strange gcc output

Hello everyone!

I am using C for almost 10 years and recently was very surprised.

Under Slackware Linux 8.1 and gcc 2.95.3 I tried to compile program
which simpler version is

----- test.c --------------
#include <termios.h>

int B0;
---------------------------

tried with
gcc -c test.c
and got
test.c:3: parse error before `0000000'

File termios.h seems not to define B0.
Could you explain me this behaviour, please?

Regards
Miroslaw Osys
Nov 13 '05 #1
4 2158
Miroslaw Osys <od**@zeus.polsl.gliwice.pl> scribbled the following:
Hello everyone! I am using C for almost 10 years and recently was very surprised. Under Slackware Linux 8.1 and gcc 2.95.3 I tried to compile program
which simpler version is ----- test.c --------------
#include <termios.h> int B0;
--------------------------- tried with
gcc -c test.c
and got
test.c:3: parse error before `0000000' File termios.h seems not to define B0.
Could you explain me this behaviour, please?


termios.h does not define B0, but bits/termios.h, included indirectly
by termios.h, does. This was found by a very simple grep operation after
a preprocess-only invocation of gcc on your code.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"C++. C++ run. Run, ++, run."
- JIPsoft
Nov 13 '05 #2
In 'comp.lang.c', Miroslaw Osys <od**@zeus.polsl.gliwice.pl> wrote:
I am using C for almost 10 years and recently was very surprised.

Under Slackware Linux 8.1 and gcc 2.95.3 I tried to compile program
which simpler version is

----- test.c --------------
#include <termios.h>

int B0;
---------------------------

tried with
gcc -c test.c
and got
test.c:3: parse error before `0000000'

File termios.h seems not to define B0.
but some include header could, or B0 could be some gcc build-in extension,
who knows...

Try again with

gcc -c -ansi -pedantic -W -Wall -O3 test.c
Could you explain me this behaviour, please?


<termios.h> is not a standard header. Pedants say that including a non
standard header invokes an undefined behaviour. I'm close to think there are
right.

Please repost to a Linux newsgroup if your concern is <termios.h>.

--
-ed- em**********@noos.fr [remove YOURBRA before answering me]
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
<blank line>
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 13 '05 #3
Hi again!

Thank for responses. It is a pity I cannot use B0 identifier even as
field name...
Probably solution is to move everything related to termios.h to separate
file.

Regards
Miroslaw Osys
Nov 13 '05 #4
In 'comp.lang.c', Miroslaw Osys <od**@zeus.polsl.gliwice.pl> wrote:
Thank for responses. It is a pity I cannot use B0 identifier even as
field name...
Probably solution is to move everything related to termios.h to separate
file.


Absolutely. It's called modular programming, and it's a Good Thing.

--
-ed- em**********@noos.fr [remove YOURBRA before answering me]
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
<blank line>
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Federico | last post by:
Hi all, I don't know if this topic is perhaps a little bit off-topic, anyway I have a strange problem in transforming an XML file in an HTML file using XSLT form a Java program written with...
2
by: Claudio | last post by:
hi all i put in this email source code so u can copy and paste to verify strange first : in this example bit size is a BYTE ?! second : in the last printf output is wrong ? ? best...
24
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone out there has run into this issue before and can shed some light on it for me. I have a stored procedure that essentially does a mini ETL from a source...
8
by: grundmann | last post by:
Hello, i got a strange compiler error. When compiling the following: // forward declarations typedef AvlTree<LineSegment,LineSegmentComperator> LSTree; void handleEventPoint (const...
8
by: Victor Lamberty | last post by:
Greetings C coders I am new to the world of C and have been trying to compile this program. I got the result that I wanted but outputed it in a strange way it put it before the prompt is there a...
6
by: leonecla | last post by:
Hi everybody, I'm facing a very very strange problem with a very very simple C program... My goal should be to write to a binary file some numbers (integers), each one represented as a sequence...
6
by: m_a_t_t | last post by:
Ok, I'm reading "The C Programming Language: 2nd Edition" and I'm on chapter 1.5.1 and here's the program you're sposed to make: #include <stdio.h> /* copy input to output; 1st version */...
9
by: fabio.bizzetti | last post by:
Hello all, I went across what seems possibly a bug of the compiler (VisualC 2005, just for the record) or a very strange and non-expected (by me at least) behaviour of the C++ ISO standard. Thus...
4
by: stat_holyday | last post by:
Greetings. I'm confused. I'm attemting to create dynamic buttons based on the count of questions in a database. The button has 3 states, blank, selected, and inactive. The script below works great,...
4
by: maria | last post by:
I only use C++ with Visual Studio 6.0 for string manipulations in thousands of HTML pages on my website. Many times, the output files of many of my C++ programs contain a spanish question mark (¿)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.