<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Porting C program from  MS Visual C++ in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559917#M725040</link>
    <description>Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I have many C programs which compile under MS Visual C++ but not on HP C/ansi C or HP C++ compiler.  The problem is around structures.  Is there an option on either of the HP Compilers which I can use to allow these structures to work as written?&lt;BR /&gt;&lt;BR /&gt;A snip of the code:&lt;BR /&gt;struct w_ioa_000&lt;BR /&gt;{&lt;BR /&gt;struct&lt;BR /&gt;{&lt;BR /&gt;char hipaa_manager_name_001as;&lt;BR /&gt;char hipaa_manager_name_001[49] /* 48 + 1 */;&lt;BR /&gt;char hipaa_queue_name_001as;&lt;BR /&gt;char hipaa_queue_name_001[49] /* 48 + 1 */;&lt;BR /&gt;char hipaa_exception_queue_na_002as;&lt;BR /&gt;char hipaa_exception_queue_name_002[49] /* 48 + 1 */;&lt;BR /&gt;char hipaa_mq_time_out_002as;&lt;BR /&gt;char hipaa_mq_time_out_002[6] /* 5 + 1 */;&lt;BR /&gt;};&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;Error message while compiling:&lt;BR /&gt;&lt;BR /&gt;cc: "EABCL837.c", line 46: warning 500: Unnamed struct/union members are ignored.&lt;BR /&gt;cc: "EABCL837.c", line 44: error 1613: Zero-sized struct.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Compile line:&lt;BR /&gt;cc -Aa -c +z -DTARGET_HPUX -D_INCLUDE_HPUX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE +DAportable   -I/t07/m2&lt;BR /&gt;10/extrn/include -o/t07/m210/extrn/src/EABCL837.o /t07/m210/extrn/src/EABCL837.c&lt;BR /&gt;&lt;BR /&gt;Thoughts?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tony</description>
    <pubDate>Wed, 01 Aug 2001 13:38:52 GMT</pubDate>
    <dc:creator>Tony Bentley_1</dc:creator>
    <dc:date>2001-08-01T13:38:52Z</dc:date>
    <item>
      <title>Porting C program from  MS Visual C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559917#M725040</link>
      <description>Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I have many C programs which compile under MS Visual C++ but not on HP C/ansi C or HP C++ compiler.  The problem is around structures.  Is there an option on either of the HP Compilers which I can use to allow these structures to work as written?&lt;BR /&gt;&lt;BR /&gt;A snip of the code:&lt;BR /&gt;struct w_ioa_000&lt;BR /&gt;{&lt;BR /&gt;struct&lt;BR /&gt;{&lt;BR /&gt;char hipaa_manager_name_001as;&lt;BR /&gt;char hipaa_manager_name_001[49] /* 48 + 1 */;&lt;BR /&gt;char hipaa_queue_name_001as;&lt;BR /&gt;char hipaa_queue_name_001[49] /* 48 + 1 */;&lt;BR /&gt;char hipaa_exception_queue_na_002as;&lt;BR /&gt;char hipaa_exception_queue_name_002[49] /* 48 + 1 */;&lt;BR /&gt;char hipaa_mq_time_out_002as;&lt;BR /&gt;char hipaa_mq_time_out_002[6] /* 5 + 1 */;&lt;BR /&gt;};&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;Error message while compiling:&lt;BR /&gt;&lt;BR /&gt;cc: "EABCL837.c", line 46: warning 500: Unnamed struct/union members are ignored.&lt;BR /&gt;cc: "EABCL837.c", line 44: error 1613: Zero-sized struct.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Compile line:&lt;BR /&gt;cc -Aa -c +z -DTARGET_HPUX -D_INCLUDE_HPUX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE +DAportable   -I/t07/m2&lt;BR /&gt;10/extrn/include -o/t07/m210/extrn/src/EABCL837.o /t07/m210/extrn/src/EABCL837.c&lt;BR /&gt;&lt;BR /&gt;Thoughts?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tony</description>
      <pubDate>Wed, 01 Aug 2001 13:38:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559917#M725040</guid>
      <dc:creator>Tony Bentley_1</dc:creator>
      <dc:date>2001-08-01T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Porting C program from  MS Visual C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559918#M725041</link>
      <description>Just off the cuff -- have you tried giving a name to the encapsulated struct? That's certainly what the compiler error seems to be complaining about.&lt;BR /&gt;&lt;BR /&gt;(Which also makes me wonder how you referenced those fields in Visual C++ -- I've never tried using an unlabeled struct as a field of a labeled one.)</description>
      <pubDate>Wed, 01 Aug 2001 14:14:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559918#M725041</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2001-08-01T14:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Porting C program from  MS Visual C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559919#M725042</link>
      <description>Hi Tony:&lt;BR /&gt;&lt;BR /&gt;Sorry, there is no #pragma or compiler option&lt;BR /&gt;to fix? this. The fundamental problem is that as declared the nested struct has no variable associated with so that the compiler cannot calculate sizes. Moreover, there is no way to address any component of the nested struct without an associated name. Even naming the nested struct e.g struct dummy doesn't help because it does not address the space allocation (or addressing) issue.&lt;BR /&gt;&lt;BR /&gt;The real fix is to make your code portable by&lt;BR /&gt;changed to something like this:&lt;BR /&gt;&lt;BR /&gt;struct w_ioa_000 &lt;BR /&gt;{ &lt;BR /&gt;struct MY_STRUCT &lt;BR /&gt;{ &lt;BR /&gt;char hipaa_manager_name_001as; &lt;BR /&gt;char hipaa_manager_name_001[49] /* 48 + 1 */; &lt;BR /&gt;char hipaa_queue_name_001as; &lt;BR /&gt;char hipaa_queue_name_001[49] /* 48 + 1 */; &lt;BR /&gt;char hipaa_exception_queue_na_002as; &lt;BR /&gt;char hipaa_exception_queue_name_002[49] /* 48 + 1 */; &lt;BR /&gt;char hipaa_mq_time_out_002as; &lt;BR /&gt;char hipaa_mq_time_out_002[6] /* 5 + 1 */; &lt;BR /&gt;} DUMMY; &lt;BR /&gt;}; &lt;BR /&gt;&lt;BR /&gt;If you have a large amount of code to change, you could probably do this with perl or awk.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 14:19:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559919#M725042</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-01T14:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Porting C program from  MS Visual C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559920#M725043</link>
      <description>Thanks for the replies.  Yes there is a larger amount of code to be changed.  A script or Perl script was discussed, but that looks like the answer.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Tony</description>
      <pubDate>Wed, 01 Aug 2001 14:33:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/porting-c-program-from-ms-visual-c/m-p/2559920#M725043</guid>
      <dc:creator>Tony Bentley_1</dc:creator>
      <dc:date>2001-08-01T14:33:44Z</dc:date>
    </item>
  </channel>
</rss>

