|
Scott explained how *CNOWIDEN controls more than just widening.
It also
controls whether the 1-byte return value is treated as an aggregate
(character string) or as a scalar (integer).
You are correct that when a C function returns char and the RPG
prototype is defined without any special EXTPROC value, then the RPG
prototype would have to define the return value as a 1-byte unsigned
integer, and then the caller would have to convert the returned value to
a 1-byte char.
By the way, you can write a C function to return a 1-byte aggregate by
defining the return value as a struct with a 1-byte subfield.
Also by the way, starting in V6R1, this difference regarding single- byte
return values disappears. Aggregate return values up to 16 bytes get
handled by the system in the same way as scalar return values.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.