<?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 Strange thing with a C program in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015897#M30933</link>
    <description>Here is the following program :&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;   fputs("        dcc: C programs checker. Copyright 1995 Supelec.\n", stdout);&lt;BR /&gt;   fputs("1 warning(s) reported (0 message(s) masked).", stderr);&lt;BR /&gt;   (void) getchar();&lt;BR /&gt;   fputs("----------------------------------------\n", stdout);&lt;BR /&gt;   fputs("Stderr2\n", stderr);&lt;BR /&gt;   fputs("Stderr21\n", stderr);&lt;BR /&gt;   return 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;If you run it on a Unix system, it's OK.&lt;BR /&gt;&lt;BR /&gt;If you run it on an OpenVMs system there is a problem because Stderr2 is written on the same line as the dashes so there is no return to the line after the first fputs.&lt;BR /&gt;&lt;BR /&gt;if you comment the getchar, it's working....&lt;BR /&gt;&lt;BR /&gt;Is it a bug or an hidden feature ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Fri, 04 Jul 2003 15:49:08 GMT</pubDate>
    <dc:creator>Daniel Clar</dc:creator>
    <dc:date>2003-07-04T15:49:08Z</dc:date>
    <item>
      <title>Strange thing with a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015897#M30933</link>
      <description>Here is the following program :&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;   fputs("        dcc: C programs checker. Copyright 1995 Supelec.\n", stdout);&lt;BR /&gt;   fputs("1 warning(s) reported (0 message(s) masked).", stderr);&lt;BR /&gt;   (void) getchar();&lt;BR /&gt;   fputs("----------------------------------------\n", stdout);&lt;BR /&gt;   fputs("Stderr2\n", stderr);&lt;BR /&gt;   fputs("Stderr21\n", stderr);&lt;BR /&gt;   return 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;If you run it on a Unix system, it's OK.&lt;BR /&gt;&lt;BR /&gt;If you run it on an OpenVMs system there is a problem because Stderr2 is written on the same line as the dashes so there is no return to the line after the first fputs.&lt;BR /&gt;&lt;BR /&gt;if you comment the getchar, it's working....&lt;BR /&gt;&lt;BR /&gt;Is it a bug or an hidden feature ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 04 Jul 2003 15:49:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015897#M30933</guid>
      <dc:creator>Daniel Clar</dc:creator>
      <dc:date>2003-07-04T15:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Strange thing with a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015898#M30934</link>
      <description>Hello Daniel,&lt;BR /&gt;&lt;BR /&gt;the problem is the missing \n at teh end of the &lt;BR /&gt;&lt;BR /&gt; fputs("1 warning(s) reported (0 message(s) masked).", stderr); &lt;BR /&gt;&lt;BR /&gt;line. So stderr tries to continue to write on the same line as before, which has already been used &lt;BR /&gt;by stdout.&lt;BR /&gt;&lt;BR /&gt;Add the \n and your output should look ok.&lt;BR /&gt;&lt;BR /&gt;Greetings, Martin</description>
      <pubDate>Sat, 05 Jul 2003 01:03:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015898#M30934</guid>
      <dc:creator>Martin P.J. Zinser</dc:creator>
      <dc:date>2003-07-05T01:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Strange thing with a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015899#M30935</link>
      <description>Martin,&lt;BR /&gt;&lt;BR /&gt;I agree that it could be fixed this way, but why does it work on a Unix system ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Jul 2003 07:38:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015899#M30935</guid>
      <dc:creator>Daniel Clar</dc:creator>
      <dc:date>2003-07-05T07:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Strange thing with a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015900#M30936</link>
      <description>Hello Daniel,&lt;BR /&gt;&lt;BR /&gt;I am not entirely sure about this either. It is &lt;BR /&gt;obviously an interaction between the various I/O streams on the terminal device. Each single stream behaves exactly as you would expect. To see this do the following:&lt;BR /&gt;&lt;BR /&gt;$define/user sys$output out.txt&lt;BR /&gt;$define/user sys$error err.txt&lt;BR /&gt;&lt;BR /&gt;then run your test program. Afterwards out.txt and err.txt do contain exactly what you would expect from the fputs statements, i.e. without the \n err.txt is &lt;BR /&gt;&lt;BR /&gt;1 warning(s) reported (0 message(s) masked).Stderr2&lt;BR /&gt;Stderr21&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Greetings, Martin</description>
      <pubDate>Sat, 05 Jul 2003 14:43:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/strange-thing-with-a-c-program/m-p/3015900#M30936</guid>
      <dc:creator>Martin P.J. Zinser</dc:creator>
      <dc:date>2003-07-05T14:43:13Z</dc:date>
    </item>
  </channel>
</rss>

