tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Const copy?


From: Philippe Ribet
Subject: [Tinycc-devel] Const copy?
Date: Tue, 10 Jun 2003 09:53:54 +0200

static const rsoc MRSOC = {
    {
        RSOC_SIZE,
        ....

static void rsoc_malloc(na_env*nae) {
  rsoc* r = ((rsoc*)(se_malloc(RSOC_SIZE)));
  rsoc_count++;
  *r=MRSOC;

I'm quite surprised because tcc refuses to copy const value in non-const
variable. The error message is:
hello_world1.c:1373: cannot cast 'const struct s_rsoc' to 'struct
s_rsoc'

Our aim is to use the const value as a model to initialize the
variable. I do not understand why C rules forget this.

    Best regards,

--
Philippe Ribet

                         The README file said
              "Requires Windows 95, NT 4.0, or better."
                    So... I installed it on Linux!







reply via email to

[Prev in Thread] Current Thread [Next in Thread]