Need utility to check that our functions' RETURN & RETURNING statements are consistent
Posted in 1996
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
In trying to upgrade from Informix for AIX version 4.1X to 6.X (I think) 4gl, we have discovered that we have been getting away with some pretty unsavory things involving RETURN statements. 1) In a function, we may decide to bail based on security or the user hits a key indicating they want out. When this happens we issue a RETURN statement. The problem is that when the number of return values changed, we did not catch all the RETURN statements in the function so now some return one number of parms and some return a different number. 2) Similarly, we got away with not returning the correct number of parameters in function calls. We got away with this in 4.1x (the program did not bomb) but I shudder to think about what's happening to the stack. We caught on to this problem because in porting to the newer version of Informix, we now bomb. We have over 3000 functions and half a million lines of code so going through this manually would be less than fun. Has anyone else run into this and written a utility to parse the source code and point out the problems? If so I'd LOVE to use it. If not, I'll be writing one so if you need one let me know (I'll probably use awk or something). Any help/advice will be greatly appreciated, -Greg (gregg@medcmp.com)