Re: quick and rudimentary

New Message Reply Date view Thread view Subject view Author view

Stephen Maher (maher++at++holodeck.gsfc.nasa.gov)
Wed, 14 Oct 1998 09:54:33 -0400 (EDT)


Steve Baker writes:
>
> On Mon, 12 Oct 1998, Mario Veraart wrote:
>
> > > I'm tired of these compiler warnings
> > >
> > > "float (*)[4]" is incompatible with parameter of type "const float (*)[4]"
> > >
> > > I want to do things like
> > >
> > > pfMatrix m1,m2,m3;
> > > pfPostMultMat(m2,m3);
> > > pfPostMultMat(m1,m2);
> > >
> > > (e.g., reuse constant input matrices as output matrices)
> > >
> > > Any tips? (Besides disabling this warning or switching to C++ :)
> > >
> > > Thanks,
> > > Steve
> > > --
> > > stephen.maher++at++gsfc.nasa.gov (301) 286-3368 fax:(301) 286-1776
> >
> > Use the #pragma to set and reset warning numbers around some parts of
> > the code
> >
> > #pragma set woff 1122
> >
> > <code that generates warning 1122>
> >
> > #pragma reset woff 1122
>
> Ack! The problem is that those warning numbers change from one SGI C/C++ compiler
> to the next. This code might turn off the 'const' message now - but next time
> it might turn off the 'unused variable' warning or something else that you should
> really care about.
>
> Can't you use a 'cast' to fix it? (I don't use C so I don't know for sure):
>
> pfPostMultMat(m2,(const float (*)[4]) m3);
>

No. The C compiler doesn't like type qualifiers like const and volatile
in cast expressions.

Steve

> ???
>
> Steve Baker (817)619-2657 (Vox/Vox-Mail)
> Raytheon Systems Inc. (817)619-2466 (Fax)
> Work: SBaker++at++link.com http://www.hti.com
> Home: SJBaker1++at++airmail.net http://web2.airmail.net/sjbaker1
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Oct 14 1998 - 06:54:49 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.