This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

A oddity... can anyone explain this?



Compile this little file with egcs-1.1.1.

#include <stdlib.h>

typedef enum
{
	BIG_ENDIAN,
	LITTLE_ENDIAN
} ENDIAN_TYPE;

main()
{
}

It comes up with:

tahallah[alex]:/home/alex/src/test > gcc endian.c -o endian
endian.c:5: parse error before `4321'

I did a quick grep around and found a whole bunch of BIG_ENDIAN defines in
the includes, but the odd thing was that they were all prefixed with __. 

This is from endian.h in /usr/include.

#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN    4321
#define __PDP_ENDIAN    3412

I'm at a loss as to why this should generate an compiler error when my
definitions aren't prefixed with '__'.

Cheers,
Alex
--
 /\_/\  Legalise cannabis now! 
( o.o ) Grow some cannabis today!
 > ^ <  Peace, Love, Unity and Respect to all.

http://www.tahallah.demon.co.uk - *new* - Leaving the States for good!