GCC rejecting (I think) valid code

Jonathan Wakely cow@compsoc.man.ac.uk
Sun Jan 23 00:28:00 GMT 2005


On Sat, Jan 22, 2005 at 10:58:21PM +0100, Sam Lauber wrote:

> typedef short int16_t;

This is equivalent to:

typedef signed short int16_t;

> typedef unsigned int16_t uint16_t;

so this is equivalent to:

typedef unsigned signed short int16_t;

which, as GCC says, does not name a type.

You seem to be expecting behaviour like this:

#define int16_t short;
typedef unsigned int16_t uint16_t;

But typedefs do not work like the preprocessor,

jon

-- 
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
	- M.A. Jackson



More information about the Gcc mailing list