home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!apollo.hp.com!netnews
- From: mishkin@apollo.HP.COM (Nathaniel Mishkin)
- Newsgroups: comp.sys.apollo
- Subject: Re: NCS: problems compiling in ANSI C
- Keywords: NCS
- Message-ID: <Btnoz5.CIA@apollo.hp.com>
- Date: 27 Aug 92 19:04:16 GMT
- References: <1992Aug26.102340.23358@ghost.dsi.unimi.it>
- Sender: usenet@apollo.hp.com (Usenet News)
- Organization: Hewlett-Packard Company - Distributed Object Computing Program / East
- Lines: 68
- Nntp-Posting-Host: mapcar.ch.apollo.hp.com
-
- In article <1992Aug26.102340.23358@ghost.dsi.unimi.it>, giachino@ghost.dsi.unimi.it (luca giachino) writes:
- >You normally include these files in the manager sources,
- >where you actually insert the bodies of the server functions.
- >You might be in the need of rendering those functions invisible
- >to the other sources, defining them as static. In this way
- >the linker doesn't complain when you define different managers
- >for the same interface.
- >
- >But the ANSI C compiler does complain issuing a warning because
- >these static functions appear defined with two different prototypes:
- >in the include file as simple "#extern type function(type arg, ...)",
- >and in the manager source as "static type function(type arg, ...)".
- >
- >Is anybody able to tell me a way for avoiding those annoing warnings?
-
- This isn't an ideal solution, but I think it's a reasonable workaround:
- use the NIDL compiler "-m" switch and name your static manager routines
- something other than what's in the .idl file. E.g.,
-
- foo.idl:
-
- interface foo
- {
- some_op(
- /* parameters */
- );
-
- some_other_op(
- /* parameters */
- );
- }
-
- server.c:
-
- #include "foo.h"
-
- static my_some_op(/* parameters */)
- {
- /* manager routine body */
- }
-
- static my_some_other_op(/* parameters */)
- {
- /* manager routine body */
- }
-
- static foo_vN$epv_t my_foo_epv = {
- my_some_op,
- my_some_other_op
- };
-
- main()
- {
- ...
- rpc_$register_mgr(&uuid_$nil, &foo_vN$if_spec,
- foo_vN$server_epv,
- (rpc_$mgr_epv_t) &my_foo_epv, &status);
- ...
- }
-
- You can read the documentation for more info on the "-m" switch and
- rpc_$register_mgr() call.
-
- --
- -- Nat Mishkin
- Distributed Object Computing Program / East
- Hewlett-Packard Company
- mishkin@apollo.hp.com
-