#define int long (WAS: Are the criteria for Unix and PC compilers different?

Joseph D. Shapiro shap at bunker.UUCP
Tue Mar 15 04:00:30 AEST 1988


In article <22314ad9 at ralf.home>, Ralf.Brown at B.GP.CS.CMU.EDU writes:
> #define int long
> 
> Need I say more?

There is a big reason why this wont work:

All of the library routines expect 'int's to be on the stack when they
are invoked.

Since you will now be calling them with 'long's, and they don't know
it, what they will really get is half of your new long argument for the
intended int, and then the other half where it was expecting some other
argument.

Of course, if there is a full set of function templates defined BEFORE
you define int to long, the compiler will fix it up.  But anyone who
could spend the time to provide templates could also use longs when
they meant longs, etc.

-- 
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Joe Shapiro					"My other car is a turbo...
Bunker Ramo Olivetti				 too."
{decvax,yale,philabs,oliveb}!bunker!shap



More information about the Comp.lang.c mailing list