home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / programm / 4329 < prev    next >
Encoding:
Text File  |  1992-08-19  |  2.1 KB  |  70 lines

  1. Xref: sparky comp.os.os2.programmer:4329 comp.os.os2.misc:27759
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!news.dell.com!natinst.com!uma
  3. From: uma@natinst.com (Uma Arunkumar)
  4. Newsgroups: comp.os.os2.programmer,comp.os.os2.misc
  5. Subject: C Set/2
  6. Message-ID: <1992Aug19.203811.15056@natinst.com>
  7. Date: 19 Aug 92 20:38:11 GMT
  8. Sender: news@natinst.com
  9. Organization: National Instruments, Austin, TX
  10. Lines: 57
  11. Nntp-Posting-Host: falcon.natinst.com
  12.  
  13.  
  14.  
  15. ****************** C Set/2   QUESTION ************************
  16. I am trying to compile a Microsoft C 6.0 C program 
  17. in C Set/2 version 1.00.
  18.  
  19.    The program compiles without errors in MSC 6.0.  But
  20.    it is giving errors at one point.
  21.  
  22.  (i)  There is a structure like the one below in "prog1a.h":
  23.    struct {
  24.           short a;
  25.           short b;
  26.           short (* fun_name)();
  27.    } command;
  28.  
  29.   (ii) There is an array of structures in "prog1.c"
  30.        which has the above structure type.
  31.        I am initializing the array of structures.
  32.        commands cmd_array[] = { 
  33.                               {1,    2,   Test1}
  34.                               {3,    4,   Test2}
  35.    };
  36.  
  37.   (iii) The problem arises in initializing.  Test1 and Test2 are given
  38.         prototypes in a file called "prog1b.h" as
  39.         
  40.         extern short Test1(short p, short q, short r);
  41.         extern short Test2(short x, short y);
  42.  
  43.   (iv) When I compile giving the command 
  44.             icc /c /w3 /o+ prog1.c prog1a.h prog1b.h
  45.  
  46.        I get the following error messages:
  47.  
  48.        1. error EDC0227 : The return types of the functionm pointers are incompatible.
  49.        2. informational EDC0140: Operand has type pointer to _Optlink function returning signed short integer.
  50.        3. informational EDC0140: Operand has type _Optlink function returning signed short integer.
  51.  
  52.        WHAT DOES THIS MEAN?
  53.        How should I initialize a table with function pointers?
  54.        In MSC 6.0, the function name evaluates into pointer expression.
  55.        How about C Set/2?
  56.        What is wrong in the above code?
  57.  
  58.  
  59. I WOULD HIGHLY APPRECIATE SOME HELP.
  60.  
  61. Thanks in advance.
  62.  
  63. My Email address is uma@natinst.com.
  64.  
  65. uma.
  66.  
  67.  
  68.        
  69.    
  70.