Re: Request
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Wed, 03 Jan 2007 01:16:02 -0500
jacob navia wrote:
.... snip ...
OK This is a misunderstanding then. The test is intended only
for 32 bit systems
Updated version:
#include <stdlib.h>
#include <limits.h>
#include <stdio.h> // for printf
int main(void)
{
int s = sizeof(size_t)*CHAR_BIT;
if (s == 32 && NULL != calloc(65521,65552))
printf("BUG!!!!\n");
return 0; // For C89 compilers
}
Wrong. A size_t object can include other padding bits. You need
to work with SIZE_MAX or (size_t)-1. Don't you care enough about
your posts to format them properly?
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
.
- References:
- Request
- From: jacob navia
- Re: Request
- From: Walter Roberson
- Re: Request
- From: jacob navia
- Re: Request
- From: Walter Roberson
- Re: Request
- From: jacob navia
- Request
- Prev by Date: Re: C puzzle
- Next by Date: Re: Request
- Previous by thread: Re: Request
- Next by thread: Re: Request
- Index(es):
Relevant Pages
|