🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #41403

Turbo C v1.0 bug?

#41403
From: Joep Mathijssen
Date: Wed, 28 Feb 1990 10:52
34 lines
1186 bytes
||   #include <stdio.h>
||   
||   long tab[9000];
||   
||   main()
||   {
||       int i;
||       long j;
||   
||       i = 0x2000;      /* 0x2000 = 8192 */
||       j = 0x2000L;
||       fprintf(stderr, "%lx, %lx\n", &(tab[i]), &(tab[j]));
||   }
||   
||   

RESULT:

||   561b2, 661b2

Can anybody explain the difference in the result when using an 'int' or
'long int' as array-index?

Joep,


PS: don't tell me this is a feature!
===============================================================================
Joep Mathijssen
TNO Institute for Perception
P.O. Box 23          		Phone : +31 34 63 562 11
3769 ZG  Soesterberg    	E-mail: tnosoes!joep@mcvax.cwi.nl
The Netherlands         	    or: uunet!mcvax!tnosoes!joep
===============================================================================
Technical Details
Message-ID: <870@tnosoes.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!tnosoes!joep

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!tnosoes!joep
From: joep@tnosoes.UUCP (Joep Mathijssen)
Newsgroups: comp.sys.atari.st
Subject: Turbo C v1.0 bug?
Message-ID: <870@tnosoes.UUCP>
Date: 28 Feb 90 10:52:00 GMT
Organization: TNO Institute for Perception, Soesterberg, The Netherlands
Lines: 34