Pelles C forum

Pelles C => Bug reports => Topic started by: AlexN on May 25, 2009, 12:32:08 PM

Title: Problem with malloc.h in RC2
Post by: AlexN on May 25, 2009, 12:32:08 PM
when I compile the following source, I get some errors in malloc.h

Code: [Select]
#include <windows.h>
#include <malloc.h>

int main()
{
return 0;
}

Errors:
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ')' but found '('.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2120: Redeclaration of 'size_t', previously declared at D:\Programme\ASw\Compiler\PellesC\Include\wchar.h(40); expected 'unsigned int' but found 'void'.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ';' but found ')'.
Title: Re: Problem with malloc.h in RC2
Post by: Pelle on May 25, 2009, 03:52:36 PM
Yet another reason to use stdlib.h, then...  ;)

For now it should work if you change line 38 from:
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc((n),(m))
to: (remove the parenthesis around n and m)
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc(n,m)
Title: Re: Problem with malloc.h in RC2
Post by: AlexN on May 25, 2009, 09:09:04 PM
Yet another reason to use stdlib.h, then...  ;)

For now it should work if you change line 38 from:
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc((n),(m))
to: (remove the parenthesis around n and m)
Code: [Select]
#define _mm_malloc(n,m)  _mm_malloc(n,m)


Thanks Pelle!

I found it and I think to say (write) it would help to make Pelles C a little bit better (and it a great peace of software).  ;)
Title: Re: Problem with malloc.h in RC2
Post by: Pelle on May 26, 2009, 08:14:07 PM
OK - thanks.
Title: Re: Problem with malloc.h in RC2
Post by: AlexN on July 10, 2009, 10:12:37 PM
when I compile the following source, I get some errors in malloc.h

Code: [Select]
#include <windows.h>
#include <malloc.h>

int main()
{
return 0;
}

Errors:
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ')' but found '('.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2120: Redeclaration of 'size_t', previously declared at D:\Programme\ASw\Compiler\PellesC\Include\wchar.h(40); expected 'unsigned int' but found 'void'.
D:\Programme\ASw\Compiler\PellesC\Include\Win\malloc.h(33): error #2001: Syntax error: expected ';' but found ')'.


This works with Pelles C RC3! :)

Thanks Pelle !!!
Title: Re: Problem with malloc.h in RC2
Post by: Pelle on July 11, 2009, 04:45:57 PM
Good - thanks!