home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.os2.programmer:4329 comp.os.os2.misc:27759
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!news.dell.com!natinst.com!uma
- From: uma@natinst.com (Uma Arunkumar)
- Newsgroups: comp.os.os2.programmer,comp.os.os2.misc
- Subject: C Set/2
- Message-ID: <1992Aug19.203811.15056@natinst.com>
- Date: 19 Aug 92 20:38:11 GMT
- Sender: news@natinst.com
- Organization: National Instruments, Austin, TX
- Lines: 57
- Nntp-Posting-Host: falcon.natinst.com
-
-
-
- ****************** C Set/2 QUESTION ************************
- I am trying to compile a Microsoft C 6.0 C program
- in C Set/2 version 1.00.
-
- The program compiles without errors in MSC 6.0. But
- it is giving errors at one point.
-
- (i) There is a structure like the one below in "prog1a.h":
- struct {
- short a;
- short b;
- short (* fun_name)();
- } command;
-
- (ii) There is an array of structures in "prog1.c"
- which has the above structure type.
- I am initializing the array of structures.
- commands cmd_array[] = {
- {1, 2, Test1}
- {3, 4, Test2}
- };
-
- (iii) The problem arises in initializing. Test1 and Test2 are given
- prototypes in a file called "prog1b.h" as
-
- extern short Test1(short p, short q, short r);
- extern short Test2(short x, short y);
-
- (iv) When I compile giving the command
- icc /c /w3 /o+ prog1.c prog1a.h prog1b.h
-
- I get the following error messages:
-
- 1. error EDC0227 : The return types of the functionm pointers are incompatible.
- 2. informational EDC0140: Operand has type pointer to _Optlink function returning signed short integer.
- 3. informational EDC0140: Operand has type _Optlink function returning signed short integer.
-
- WHAT DOES THIS MEAN?
- How should I initialize a table with function pointers?
- In MSC 6.0, the function name evaluates into pointer expression.
- How about C Set/2?
- What is wrong in the above code?
-
-
- I WOULD HIGHLY APPRECIATE SOME HELP.
-
- Thanks in advance.
-
- My Email address is uma@natinst.com.
-
- uma.
-
-
-
-
-