Old Wolf wrote:
> On Feb 10, 3:52 am, Yevgen Muntyan <muntyan.removet...@tamu.edu>
> wrote:
>> Consider the following macro:
>>
>> #define ALLOCIT(Type) ((Type*) malloc (sizeof (Type)))
>
> Have you considered:
> #define ALLOCIT(Type) ((Type*) (Type*) (Type *) \
> (&malloc)(sizeof(Type) * 1 + 0 - 0))
>
> ?
Of course. As well as
#define ALLOCIT(Type) ((Type*)(Type*) malloc (15 * sizeof (Type) + 1

)
In fact I am using a better version:
#define ALLOCIT(Type) ((Type*)(char*) malloc (MAX (42, sizeof (Type))))
>> I make a conclusion: void* is evil and must be avoided
>> when possible and easy.
>
> I go out of my way to use (void *) as much as possible,
> when the type of the storage is not relevant.
Which is irrelevant.