× 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.


  • Subject: Re: API parameter lengths
  • From: "Steve Richter" <srichter@xxxxxxxxxxxxx>
  • Date: Mon, 9 Jul 2001 12:38:58 -0400


-----Original Message-----
From: Alexei Pytel <pytel@us.ibm.com>
To: MI400@midrange.com <MI400@midrange.com>
Date: Monday, July 09, 2001 12:03 PM
Subject: Re: API parameter lengths


>
>CALL command does not do this.
>C PEP (program entry point) procedure does. For every main() in C, compiler
>generates a PEP (you may see it if you do DSPMOD on C module). This PEP
>procedure among other things will scan for first blank in each parameter
>and create null-terminated string for each parameter.
>This makes it very difficult to pass non-character parameters to C main().
>
>    Alexei Pytel


how does the C pgm know the max lgth/sizeof  the char parm?

Some pgms ( like qcmdexc ) rcv a lgth parameter and the char parm is max
lgth. Scanning the complete declared lgth of the char parm could result in a
space overrun exception.  no?

also,
What happens at pgm exit?
Will the created null term string be copied back to the passed by addr
variable of the calling pgm?
Does that not risk an overrun of the variable passed by the calling pgm?

Is this moot now because of ILE, one of its few positive contributions to
our platform?

thanks,
Steve Richter

ps: excellent response Simon!




+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.