Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jarthur!nntp-server.caltech.edu!eql.caltech.edu!rankin From: rankin@eql.caltech.edu (Pat Rankin) Newsgroups: comp.lang.c Subject: Re: Is this ok?? Message-ID: <1991Mar8.042321.11824@nntp-server.caltech.edu> Date: 8 Mar 91 04:02:34 GMT References: <1991Mar7.173712.18201@zoo.toronto.edu> Sender: news@nntp-server.caltech.edu Reply-To: rankin@eql.caltech.edu Organization: Environmental Quality Laboratory, Caltech Lines: 31 News-Software: VAX/VMS VNEWS 1.3-4x >In article davis@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@zoo.toronto.edu> henry@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 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@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@eql.caltech.edu