From: cowan@btgmax.zko.dec.com (Ken Cowan)
Subject: Re: Problem with RMS structures in DEC C?
Date: 1995/07/06 [thread overview]
Message-ID: <3tgp1a$mup@sousa.tay1.dec.com> (raw)
In-Reply-To: DB55Fn.5Du@bath.ac.uk
In article <DB55Fn.5Du@bath.ac.uk>, 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 <stdlib.h>
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
prev parent reply other threads:[~1995-07-06 4:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-06-29 4:00 Problem with RMS structures in DEC C? P A Keller
1995-06-29 4:00 ` Carl J Lydick
1995-06-29 4:00 ` Bruce Milton
1995-06-30 4:00 ` David Claude Brown
1995-06-30 4:00 ` Carl J Lydick
1995-07-03 4:00 ` P A Keller
1995-07-05 4:00 ` Hein RMS van den Heuvel
1995-07-06 4:00 ` Ken Cowan [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox