Re: [cc65] sizeof(struct ...)

From: Johan Kotlinski <kotlinski1gmail.com>
Date: 2009-08-08 10:19:09
I'm not sure, but the following compiles fine for me using pretty new
snapshot version (v2.12.9):

#include <stdlib.h>

struct someStruct
{
    int a;
    int b;
    int c;
    int d;
};

void main()
{
    int *ptr = malloc(sizeof(struct someStruct));
}

So, it should work..?

Johan


On Sat, Aug 8, 2009 at 7:37 AM, Scott Hutter<scott.hutter@gmail.com> wrote:
> Im getting an error "Error: Size of data type is unknown" for the following
> code:
>
> struct someStruct
> {
>     int a;
>     int b;
>     int c;
>     int d;
> };
>
> later...
>
> int *ptr;
>
> ptr = malloc(sizeof(struct someStruct));
>
> Is my syntax faulty, or does the compiler not support this?
>
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Aug 8 10:19:33 2009

This archive was generated by hypermail 2.1.8 : 2009-08-08 10:19:35 CEST