Is this ok??

Pat Rankin rankin at eql.caltech.edu
Fri Mar 8 14:02:34 AEST 1991


>In article <DAVIS.91Mar6213546 at pacific.mps.ohio-state.edu> davis at pacific.mps.ohio-state.edu  (John E. Davis) writes:
>    The following code works on sun4 and ultrix but crashes on VMS.
> Just when I thought I understood pointers.....

     Your pointer usage looks correct.  Are you using VAX C V3.0?
Its optimizer had some problems with inlining functions.  Try using
``cc/nooptimize'' or ``cc/opt=noinline'', or upgrade to V3.1 (which
was released more than a year ago).

     You should always retry with optimization suppressed when something
you're reasonably sure is correct gives the wrong results.

>In article <1991Mar7.173712.18201 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
> My tentative diagnosis is that you understand pointers but don't understand
> VMS exit status!  0 is *not* "success" in VMS.

     He would have hit that next.  Even ``return EXIT_SUCCESS;'' wouldn't
help unless he defined EXIT_SUCCESS manually, because the the VAX C
version of <stdlib.h> currently has the wrong value for VMS (it's 0, when
VMS really does need 1 for success; it has 2 for EXIT_FAILURE, which is
suitable but not optimal).

In article <PJT.91Mar7191135 at dharma.cpac.washington.edu>, pjt at cpac.washington.edu (Larry Setlow) writes...
> I've redirected followups to comp.os.vms, since this line of
> discussion has become VMS-specific.

     The question was about pointers, not about VMS.  Exit status is a
red herring here.  Known compiler problems are appropriate for this group,
as are suggestions to use EXIT_xx macros instead of hard coded exit values.

		Pat Rankin, rankin at eql.caltech.edu



More information about the Comp.lang.c mailing list