From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
Subject: Re: Problem with RMS structures in DEC C?
Date: 1995/06/29 [thread overview]
Message-ID: <3sul2o$rt8@gap.cco.caltech.edu> (raw)
In-Reply-To: DAxxAM.B7r@bath.ac.uk
In article <DAxxAM.B7r@bath.ac.uk>, bsspak@bath.ac.uk (P A Keller) writes:
=Hi everyone. Can anyone explain why the following minimal code won't
=compile without error under DEC C?
It's not giving you an error, it's giving you a warning.
=VAX C is fine, as well as DEC C with the
=/STANDARD=VAXC option. As far as I can see, there is nothing here which
=conflicts with the example in the DEC C documentation, or am I just being
=dim?
=
=#include <rms.h>
=
=struct FAB infab;
=struct XABFHC inxab;
=
=void func (void) {
=
= infab = cc$rms_fab;
= inxab = cc$rms_xabfhc;
= infab.fab$l_xab = &inxab;
=}
=
=produces
=
= infab.fab$l_xab = &inxab;
=....^
=%CC-W-PTRMISMATCH, In this statement, the referenced type of the pointer value
="&inxab" is "struct xabfhcdef", which is not compatible with "char".
=at line number 10 in file DKA100:[USERS.PETER.CIF]RMS.C;5
Well, as the error message tells you, you've got a pointer mismatch. The
compiler is warning you about that. If you don't want the warning, you've got
to let the compiler know that you know there's a mismatch, but want to make th
assignment anyway. The way to do that is by casting the reference to the
pointer to the XAB:
#include <rms.h>
struct FAB infab;
struct XABFHC inxab;
void func (void) {
infab = cc$rms_fab;
inxab = cc$rms_xabfhc;
infab.fab$l_xab = (char *) &inxab;
}
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My
understanding of astronomy is purely at the amateur level (or below). So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it. If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.
next prev parent reply other threads:[~1995-06-29 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 ` Bruce Milton
1995-06-29 4:00 ` Carl J Lydick [this message]
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
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