Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uhccux!munnari.oz.au!bruce!monu1!vaxc!phs318u From: TMcG@Physics.Monash.Edu.Au (Tony McGrath) Newsgroups: gnu.gcc Subject: Re: Problem with gcc 1.35 under vms 5.1 Message-ID: <7215@vaxc.cc.monash.edu.au> Date: 19 Aug 89 09:25:57 GMT References: <2686@daimi.dk> <2761@daimi.dk> Sender: phs318u@vaxc.cc.monash.edu.au Organization: Monash University - Australia. Lines: 72 In article <2761@daimi.dk>, mkemi@daimi.dk (Morten Kjeldsgaard) writes: > I wanted to test what predefined names exists in the gcc system. I made a > program containing several possiblities, gcc,gnu,vms,unix etc. But the > resulting program gave me problems. I shaved the program down to the > following, and compiled it with my gcc version 1.35 compiler on a microvax > II, vms 5.1: > > define.c: > > main() > { > printf("vms defined\n"); > } > > Here is what happens when define.exe runs: > > $ run define > vms defined > %SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000C, > PC=0000000C, PSL=00000004 > But... > printf("vms define\n"); .. works !!! Furthermore ... > printf("hello, world I am defined\n"); ...didn't work !!! I carried out the same test with GCC 1.22 (and 1.24) on a Vax 8700 VMS 4.7 and got the same results. > Yes, there seems to be a problem when you print out the word "defined". No, it's not the word "define". The error message returned by VMS after the program in executed is related to the length of the string you are trying to print. If you run the program and then check out the value of $STATUS you will see that the value returned coincides with the length of the string in the PRINTF statement. Also you only get the error message if the value of $STATUS is even, i.e. the low bit is NOT set so VMS assumes something went wrong. That is why your second experiment worked. You can overcome this problem if you include in SSDEF, the "System Service Return Status Code Definitions", and call the EXIT routine with appropriate argument at the end of your MAIN program. So now you end up with : #include main() { printf("vms defined\n"); exit(SS$_NORMAL); } > A compiler bug, or what? Seems that way. Cheers, Tony -- Tony McGrath, Physics Dept., Monash Uni. VIC 3168, Australia Internet: TMcG@vaxc.cc.monash.edu.au Ph: +61 3 565 3666 FAX: +61 3 565 3637 ACSnet: TMcG@vaxc.cc.monash.oz PSI: PSI%+505235621000::TMCG