Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: gcc misplacing pointers?



Scott Stone writes:
 > 
 > I had the strangest thing happen.. on two separate machines, with 2
 > different versions of libc and gcc, even..:
...
 > problem.
 > 
Hi,
just to be clear. Does your program look like this:

#include <stdio.h>
int main()
{
  stuff();
}


stuff(){
  char *s0;
  int t;
 
  s0=(char *) malloc(sizeof(char));
  
  for (t=33;t<33+80;t++) s0[t-33]=(char) t;
  printf ("%s\n",s0);
  free(s0);
}


This works for me. If you have any differences, what are they?

Marcus

-- 
-----------------------------------------------
Dr. Marcus Metzler
Department of Physics
Toho University
Miyama 2-2-1, Funabashi, Chiba 274
Japan

e-mail : mocm@example.com
-----------------------------------------------
---------------------------------------------------------------
Next TLUG Nomikai: 11 March Wed 1998 Tengu TokyoEkiMae 19:30
Chuo-ku, Kyobashi 1-1-6, EchiZenYa Bld. B1/B2 03-3275-3691
Next TLUG Meeting: 11 April 1998 Saturday, Tokyo Station
Featuring Tague Griffith of Netscape i18n talking on source code
---------------------------------------------------------------
a word from the sponsor:
TWICS - Japan's First Public-Access Internet System
www.twics.com  info@example.com  Tel:03-3351-5977  Fax:03-3353-6096



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links