Re: Problem: 4GL-Compiler, DEC Alpha AXP, OSF/1 FOR-statement
Posted in 1993
->From: btv002@btr0x1.hrz.uni-bayreuth.de (Th. Behr) ->Subject: Problem: 4GL-Compiler, DEC Alpha AXP, OSF/1 FOR-statement ->Date: 14 Oct 1993 11:11:58 GMT ->Reply-To: btv002@btr0x1.hrz.uni-bayreuth.de (Th. Behr) ->Organization: Universitaet Bayreuth -> ->Hello, ->my Problem: -> ->MAIN -> DEFINE i INTEGER -> FOR i = 5 TO 1 STEP -1 -> DISPLAY i -> END FOR ->END MAIN -> ->This FOR-Statement does nothing ! ->A look at the C-code produced with 4gl 4.1: -> ->... ->long fgl_fr1,fgl_fr2, fgl_fr3; ->... ->pushint(1) ->_doneg(); ->popint(&fgl_fr3); ->... -> ->Reference Manual about C Functions: ->Popping Functions Pushing Functions Argument Types ->popint(&i) retint(i) int i; ->poplong(&l) retlong(l) long l; -> ->I suspect some of the people at INFORMIX don't know the difference between ->long and int ! -> ->Is there any solution ? -> ->Thank you -> ->Thomas Behr -> This program works fine for me; q.v.: alan po:/home/alan/test 210 % cat counter.4gl MAIN DEFINE i INTEGER FOR i = 5 TO 1 STEP -1 DISPLAY i END FOR END MAIN alan po:/home/alan/test 211 % c4gl counter.4gl alan po:/home/alan/test 212 % a.out 5 4 3 2 1 alan po:/home/alan/test 213 % I understand your complaint: Informix is popping an int into a long. The C code generated on my machine contains the same sequences you mailed, even tho' my c4gl is version 2.10. This behaviour is okay on my Sun, where int and long are both 4 bytes long. What is your machine? What are your int and long sizes? As for a solution: I dunno. Is there some way to add a typedef into your code to make your int and long the same size? This is u-g-l-y, involving: 1. c4gl program.4gl 2. edit the program.c file produced above to add the typedef 3. c4gl program.c All-in-all, this does not look promising. I hope someone can offer you a better solution. Good luck. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, Tech Ops | / \\ alan@den.mmc.com | P.O. Box 179, M/S 5422 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\