× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



jt wrote:

|   >> But if the procedure is written in another language, then those
| languages do not have a PI defined so there is no checking until run time.
|
| All languages have the equivalent of a PI (RPG's *ENTRY PLIST is the same
| thing with different syntax) but not all have prototyping - notably CL and
| COBOL do not.

C has prototyping?  Does the RPGLE compiler validate against the C
prototype???

Yes, C has prototyping. In fact C is one of the languages with the strongest prototyping. A prototype in C looks like:


int function (char variable1, int variable2);

That is the equivalent of the PR spec in RPG. And yes, the ILE compiler validates the C prototype.



| The real problem with this statement however is "there is no
| checking until
| run time".  Leave out the words "until run time" and the statement is
| accurate.  i.e. "there is no checking".  The reason that prototyping is
| valuable is _because_ there is no run time checking of parms.

That's in the C-world.  CPF checks number of parms, and programs that pass
wrong data types consistently error off.  They don't corrupt data, generally
speaking.

C (like RPG prototypes) doesn't check prototypes at run time because they were already checked at compile time. If they didn't match, it wouldn't compile and you wouldn't be able to run it anyway. That's one reason C (and function/procedure calls) is fast.


Of course, if you screw up the call stack things can get messy...

James Rich

"As for security, being lectured by Microsoft is like receiving wise words on the subject of compassion from Stalin."
-- mormop on lwn.net



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.