This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13691] New: malloc returns eroneous pointer
- From: "janbor at fys dot uio dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2004 23:55:52 -0000
- Subject: [Bug c/13691] New: malloc returns eroneous pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
~>cat test.c
#include <stdio.h>
main()
{
int n;
double **A;
for (n=8000;n<100000;n*=2) {
A = (double **)malloc(n*sizeof(double *));
printf("%d %d \n",n,A);
}
}
~>gcc -o test test.c -lm
test.c: In function `main':
test.c:9: warning: cast to pointer from integer of different size
~>test
8000 5301488
16000 5365504
32000 -1789435888
64000 -1789177840
--
Summary: malloc returns eroneous pointer
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P1
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: janbor at fys dot uio dot no
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-pc-linux-gnu
GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13691