This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13691] malloc returns eroneous pointer
- From: "bording at bnl dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2004 00:10:45 -0000
- Subject: [Bug c/13691] malloc returns eroneous pointer
- References: <20040114235551.13691.janbor@fys.uio.no>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bording at bnl dot gov 2004-01-15 00:10 -------
Subject: Re: malloc returns eroneous pointer
Replacing %d with %ld did not change anything ! Besides, I'm not concerned
with the output - my real program craches when writing to the allocated
memory...
double **A,**B;
A = (double **)malloc(16000*sizeof(double *));
B = (double **)malloc(32000*sizeof(double *));
A[3] = 1.234; // works fine
B[3] = 1.234; // gives p0_23074: p4_error: interrupt SIGSEGV: 11
Jan
pinskia at gcc dot gnu dot org wrote:
>------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-14 23:59 -------
>invalid as pointers on x86_64 are 64bit, not 32bit which are the sizeof of an int, you want to print
>out using %ld.
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13691