* Re: PROBLEMS with DCE RPC on AIX
1995-03-16 11:21 PROBLEMS with DCE RPC on AIX Thomas Beuter
@ 1995-03-16 20:31 ` Tom Jordahl
1995-03-17 5:23 ` Gregory_Brail
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Tom Jordahl @ 1995-03-16 20:31 UTC (permalink / raw)
In article <1995Mar16.112111.26682@informatik.uni-ulm.de>,
Thomas Beuter <beuter@cocoon.informatik.uni-ulm.de> wrote:
>example:
>error_status_t rpc_call([in] long num, [out, string] char txt[20]);
>
>The IDL compiler interprets char as unsigned char (macro idl_char ->
>ndr_char -> unsigned char). Whereas the xlc compiler interprets it as
>signed char. Therefore the function's declaration in the header file
>(produced by idl compiler) isn`t compliant to the function`s
>definition.
>
>There are some solutions of this problem but none is really
>satisfying:
>- flag -qlanglvl=extended; loosing the strong type checking of
> ANSI C
>- using unsigned char or idl_char instead of char in the formal
> parameter's definition
Thomas,
This looks like it was a mistake that we tried to correct in DCE 1.1.
You are probably using an IBM DCE based on DCE 1.0.3.
I'm not sure if this will be much help,
but in <dce/idlbase.h> in the 1.1 source if the following:
/*
* when compiling DCE programs and/or libraries, we want the base type
* of idl_char to be "unsigned char" (IDL doesn't support signed chars).
* However, we compiling external programs, we want idl_char to have
* the char type native to the platform on which the program is being
* compiled. So ... use a macro that should only be defined if we
* are building the RPC runtime of the IDL compiler.
*/
#ifndef IDL_CHAR_IS_CHAR
typedef unsigned char idl_char ;
#else
typedef char idl_char ;
#endif /* idl_char */
You may be able to retrofit you header file with this change.
I would certainly contact IBM and ask them to investigate
patching their DCE product with a similar fix if their compiler
chokes in your (not uncommon?) situation.
--
Tom Jordahl Internet: tom_j@gradient.com
Gradient Technologies Inc. DCE development
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: PROBLEMS with DCE RPC on AIX
1995-03-16 11:21 PROBLEMS with DCE RPC on AIX Thomas Beuter
1995-03-16 20:31 ` Tom Jordahl
@ 1995-03-17 5:23 ` Gregory_Brail
1995-03-17 22:27 ` Trey Thompson
1995-03-21 2:56 ` Bill Janssen
3 siblings, 0 replies; 6+ messages in thread
From: Gregory_Brail @ 1995-03-17 5:23 UTC (permalink / raw)
> There are some solutions of this problem but none is really
> satisfying:
> - flag -qlanglvl=extended; loosing the strong type checking of
> ANSI C
> - using unsigned char or idl_char instead of char in the formal
> parameter's definition
I don't think this second solution is all that unsatisfying. Your
compiler never sees the .idl file, only the .h file. The .h file,
which specifies the prototype for the functions you're going to
implement on your server, says "idl_char". So, when you write those
functions, use "idl_char" in the declaration. Similarly, IDL defines
"long" to be 32 its and "short" to be 16 bits. Now, if your machine
defines "long" to be 64 bits, you could get in trouble. Using
"idl_long_int" could avoid this problem.
Nonetheless, it'd be nice if IDL translated "char" into "char" instead
of "unsigned char." Lots of C++ programmers (including myself) learned
of this behavior the hard way when their programs didn't link. If I
were smart, I would have used "idl_char" in my function declarations,
but instead I have used "unsigned char".
Another poster mentioned that DCE 1.1 changes this, and the new
behavior sounds like the right one. But unless all the C++ DCE
programmers are using "idl_char" in their function declarations
instead of "unsigned char", there are lots of C++ programs out there
that won't link when DCE 1.1 comes along.
greg
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PROBLEMS with DCE RPC on AIX
1995-03-16 11:21 PROBLEMS with DCE RPC on AIX Thomas Beuter
1995-03-16 20:31 ` Tom Jordahl
1995-03-17 5:23 ` Gregory_Brail
@ 1995-03-17 22:27 ` Trey Thompson
1995-03-21 2:56 ` Bill Janssen
3 siblings, 0 replies; 6+ messages in thread
From: Trey Thompson @ 1995-03-17 22:27 UTC (permalink / raw)
beuter@cocoon.informatik.uni-ulm.de (Thomas Beuter) writes:
>
>... xlc produces an error message "Function <rpc_call>
>cannot be redeclared". The reason is that data types are interpreted
>differently.
>example:
>error_status_t rpc_call([in] long num, [out, string] char txt[20]);
>The IDL compiler interprets char as unsigned char (macro idl_char ->
>ndr_char -> unsigned char). Whereas the xlc compiler interprets it as
>signed char. Therefore the function's declaration in the header file
>(produced by idl compiler) isn`t compliant to the function`s
>definition.
Have you tried defining AIX_PROD ? It has something to do with
problem OT7619 CMVC5209 whatever that means. I have never seen a
reference to this anywhere, but it seems to help in many cases.
You can either #define AIX_PROD somewhere or make a change in the
/etc/xlc.cfg (or /etc/xlC.cfg for C++)
Anybody from IBM want to clarify this?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PROBLEMS with DCE RPC on AIX
1995-03-16 11:21 PROBLEMS with DCE RPC on AIX Thomas Beuter
` (2 preceding siblings ...)
1995-03-17 22:27 ` Trey Thompson
@ 1995-03-21 2:56 ` Bill Janssen
1995-03-21 15:17 ` Rich Salz
3 siblings, 1 reply; 6+ messages in thread
From: Bill Janssen @ 1995-03-21 2:56 UTC (permalink / raw)
I'm sure the DCE folks can fix this problem. But you might want to
look at using ILU instead, which really does use strict ANSI C, and
also allows you to use other languages, like C++, Common Lisp,
Modula-3, or (my favorite) Python.
From the ILU 1.8 announcement:
The 1.8 release of the Inter-Language Unification (ILU) system is now
available via ftp://ftp.parc.xerox.com/pub/ilu/ilu.html. ILU is a
multi-language distributed object system that Xerox is making freely
available. It can also be used to build multi-lingual object-oriented
libraries ("class libraries") with well-specified language-independent
interfaces. It can also be used to implement RPC systems. It can
also be used to define and document interfaces in non-distributed
programs. It also provides support for use of the OMG CORBA IDL
interface description language, and can be thought of as a CORBA ORB
system (though with omissions from and extensions to the CORBA spec).
It includes a self-contained implementation of ONC RPC.
This release of ILU contains support for ANSI C, C++, Modula-3,
Python, and Common Lisp. It has been installed on many flavors of
UNIX, including SPARC machines running SunOS 4.1.3 and Solaris 2, SGI
machines running IRIX 5.2, Linux 1.78, DEC Alpha with OSF/1, RS/6000
w/AIX, and HP/UX. It supports both threaded and non-threaded
operation.
Bill
--
Bill Janssen <janssen@parc.xerox.com> (415) 812-4763 FAX: (415) 812-4777
Xerox Palo Alto Research Center, 3333 Coyote Hill Rd, Palo Alto, CA 94304
URL: ftp://parcftp.parc.xerox.com/pub/ilu/misc/janssen.html
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: PROBLEMS with DCE RPC on AIX
1995-03-21 2:56 ` Bill Janssen
@ 1995-03-21 15:17 ` Rich Salz
0 siblings, 0 replies; 6+ messages in thread
From: Rich Salz @ 1995-03-21 15:17 UTC (permalink / raw)
In <JANSSEN.95Mar20185656@holmes.PARC.Xerox.Com> janssen@parc.xerox.com (Bill Janssen) writes:
>I'm sure the DCE folks can fix this problem. But you might want to
>look at using ILU instead, which really does use strict ANSI C ...
That hardly seems like a realistic solution. Or was this a thin excuse
for a non-commercial ad?
IDL char's are defined to be translateable between ASCII and EBCDIC.
As a result, we had to play some games when mapping between "char"
in an IDL file, idl_char, and the C datatype char. DCE IDL defines
char to be unsigned. C doesn't define the signedness. As a result,
when going between IDL parameters and C library parameters, you sometimes
have to add casts. On some platforms, C char is unsigned and you can
leave off the casts. For maximum portability, don't.
I suppose ILU doesn't have this problem by only supporting 7bit ASCII.
/r$
^ permalink raw reply [flat|nested] 6+ messages in thread