Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* SIMPLE C Question?
@ 1994-07-28 18:13 Navid Atoofi
  1994-07-28 21:10 ` Steve Huston
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Atoofi @ 1994-07-28 18:13 UTC (permalink / raw)



--
Navid Atoofi			"ARYANAM KHASHATRAM"
System CAD engineer
Northeastern University
-------------------------------
I do have a problem with enum, I try to complie a program that
start like this
#include <stdio.h>
#include <signal.h>

#define	procedure	void
#define	and		&&
#define	or		||
#define	not		!
typedef enum { FALSE, TRUE} Boolean;    <--------


I am keep getting the following error

/usr/lib/cmplrs/cc/cfe: Error: export.c, line 24: Syntax Error
 typedef enum { 0, 1} Boolean;
 ---------------^

------------------------------------------------------------
Any recomendation?

enum Boolean { TRUE, FALSE } ;

will encounter the same error

if I change TRUE and FALSE to some bogus name it will compile, but ??
as soon as I define the bogus variable to 0 and 1 I will get the
same error. I tried it with gcc and cc.



Thank you


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SIMPLE C Question?
  1994-07-28 18:13 SIMPLE C Question? Navid Atoofi
@ 1994-07-28 21:10 ` Steve Huston
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Huston @ 1994-07-28 21:10 UTC (permalink / raw)



In article <318sfe$hfo@chaos.dac.neu.edu>, navid@ren.ece.neu.edu (Navid Atoofi) writes:

>typedef enum { FALSE, TRUE} Boolean;    <--------
>
>
>I am keep getting the following error
>
>/usr/lib/cmplrs/cc/cfe: Error: export.c, line 24: Syntax Error
> typedef enum { 0, 1} Boolean;
> ---------------^

This is because TRUE and FALSE are already #define'd before you get to
that point in your program (they're defined somewhere under stdio, I think).
You could:

1. #undef TRUE
   #undef FALSE

2. Pick new tags that aren't already #define'd.

--
Steve Huston                              CompuCraft
CompuServe: 72133,2372                    61 Nadeau Drive
Internet:   72133.2372@CompuServe.COM     Wrentham, MA 02093-1618
            huston@icecub.ako.dec.com     (508) 384-5770


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-07-28 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-07-28 18:13 SIMPLE C Question? Navid Atoofi
1994-07-28 21:10 ` Steve Huston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox