Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > very strange gcc output

Reply
Thread Tools

very strange gcc output

 
 
Miroslaw Osys
Guest
Posts: n/a
 
      09-07-2003
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
 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      09-07-2003
Miroslaw Osys <(E-Mail Removed)> 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 ((E-Mail Removed)) ---------------------------\
| 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
 
Reply With Quote
 
 
 
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      09-07-2003
In 'comp.lang.c', Miroslaw Osys <(E-Mail Removed)> 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- http://www.velocityreviews.com/forums/(E-Mail Removed) [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/
 
Reply With Quote
 
Miroslaw Osys
Guest
Posts: n/a
 
      09-07-2003
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
 
Reply With Quote
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      09-07-2003
In 'comp.lang.c', Miroslaw Osys <(E-Mail Removed)> 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- (E-Mail Removed) [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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Very very very basic question Peter C Programming 14 02-14-2005 09:46 AM
very very very long integer shanx__=|;- C Programming 19 10-19-2004 03:55 PM
very very very long integer Abhishek Jha C Programming 4 10-17-2004 08:19 AM
Quick Book file access very very very slow Thomas Reed Computer Support 7 04-09-2004 08:09 PM
very Very VERY dumb Question About The new Set( ) 's Raymond Arthur St. Marie II of III Python 4 07-27-2003 12:09 AM



Advertisments