From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,700ffaaadd36430b X-Google-Attributes: gidf7344,public X-Google-Thread: 1014db,700ffaaadd36430b X-Google-Attributes: gid1014db,public X-Google-Thread: 1164f8,700ffaaadd36430b X-Google-Attributes: gid1164f8,public From: cowan@btgmax.zko.dec.com (Ken Cowan) Subject: Re: Problem with RMS structures in DEC C? Date: 1995/07/06 Message-ID: <3tgp1a$mup@sousa.tay1.dec.com>#1/1 X-Deja-AN: 105730614 distribution: world references: organization: Digital Equipment Corporation reply-to: cowan@rtl.enet.dec.com newsgroups: comp.os.vms,comp.sys.dec,comp.lang.c In article , bsspak@bath.ac.uk (P A Keller) writes: |> |>Many thanks to everyone who responded to my origial query. It seems that |>the problem stems from the fact that the header files have a long history, |>and haven't been updated properly. I wonder if anyone at DEC has actually |>tried compiling the example in the DEC C documentation under DEC C? |> |>I was reluctant to take the easy option, and just put in a cast which shut |>up the compilers which I have access to, since the code which I am working |>on will have to compile on a wide variety of systems. |> |>Thanks again - I have found some of the comments very informative. |>Peter. |> |>======================================================================== |>Peter Keller. \ |>Dept. of Biology and \ "Not even the greatest nonsense is beyond |> Biochemistry, \ the reach of human invention." |>University of Bath, \ |>Bath, BA2 7AY, UK. \ --- Ryszard Kapuscinski |>------------------------------\----------------------------------------- |>Tel. (+44/0)1225 826826 x 4302 | Email: P.A.Keller@bath.ac.uk (Internet) |>Fax. (+44/0)1225 826449 | P.A.Keller%bath.ac.uk@UKACRL (BITNET) |>======================================================================== |> Which example doesn't compile? BTW, we're not planning to change the definition of fab.h. It'd be an incompatible change. Consider the program below. For the call bar( &my_a.f2 ); I get a compiler warning: bar( &my_a.f2 ); ...^ %CC-W-PTRMISMATCH, In this statement, the referenced type of the pointer value " &my_a.f2" is "Pointer to void", which is not compatible with "Pointer to char". at line number 20 in file WKD$:[LCRTL]A.C;21 --#include struct a { char *f1; void *f2; }; void bar( char **x ) { *x = (char *)malloc( 14 ); return; } main() { struct a my_a; bar( &my_a.f1 ); bar( &my_a.f2 ); } Ken Cowan, ZK2-3/Q8 cowan@rtl.enet.dec.com Digital Equipment Corporation decwrl!rtl!cowan 110 Spit Brook Rd, Nashua, NH 03062