<?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 Re: #define compiler problem still occurring - still an hpux newbie in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528657#M728652</link>
    <description>Hi Steve,&lt;BR /&gt;I running Version A.3.30 of aCC and everything worked fine.&lt;BR /&gt;&lt;BR /&gt;I defined a macro like this:&lt;BR /&gt;&lt;BACKSLASH&gt; denotes a single backslash character at the end of the line (no trailing spaces)&lt;BR /&gt;&lt;BR /&gt;#define swap(a,b,temp) &lt;BACKSLASH&gt;&lt;BR /&gt;{ &lt;BACKSLASH&gt;&lt;BR /&gt;  temp = a; &lt;BACKSLASH&gt;&lt;BR /&gt;  a = b; &lt;BACKSLASH&gt;&lt;BR /&gt;  b = temp; &lt;BACKSLASH&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Then in the main:&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int aa = -1,bb = 1,cc = 0;&lt;BR /&gt;&lt;BR /&gt;  printf("Hello world\n");&lt;BR /&gt;  swap(aa,bb,cc);&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;when I did an aCC -P myfile.c I got a myfile.i&lt;BR /&gt;which looked like this:&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int aa = -1,bb = 1,cc = 0;&lt;BR /&gt;  printf("Hello world\n");&lt;BR /&gt;  { cc = aa; aa = bb; bb = cc};&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Exactly what you would expect; you might try upgrading to the 3.30 version but I would also&lt;BR /&gt;create a macro exactly like the one above first as a test. There may be an upper limit to the length of a multi-line macro but I have used some fairly large ones (&amp;gt; 300 chars) without problems.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;</description>
    <pubDate>Tue, 15 May 2001 15:30:55 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-05-15T15:30:55Z</dc:date>
    <item>
      <title>#define compiler problem still occurring - still an hpux newbie</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528655#M728650</link>
      <description>I tried using the backslash notation for long #define lines for my code and no luck. Errors from the A.03.27 aCC compiler are still generated.  I looked at the 3.27 doc and found the following: &lt;BR /&gt;&lt;BR /&gt;"NOTE: The replacement-list must fit on one line. If the line becomes too long, it can be broken up into several lines provided that all lines but the last are terminated by a "\" character. The following is an example. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#define mac very very long \replacement string &lt;BR /&gt;&lt;BR /&gt;The "\" must be the last character on the line. You cannot add any spaces or comments after it." &lt;BR /&gt;&lt;BR /&gt;Notice that the doc says to use a backslash. Neither convention works for me. If I look at the standard includes, I see backslash continuation characters used throughout. &lt;BR /&gt;&lt;BR /&gt;Is there a compiler switch that I need to implement this behavior? My current settings are &lt;BR /&gt;&lt;BR /&gt;"-c +z +p -AA +DAportable +DD32 -DHPUX -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -D_RWSTD_MULTI_THREAD -D_RWSTD_TEMPLATE" &lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any help...</description>
      <pubDate>Tue, 15 May 2001 14:57:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528655#M728650</guid>
      <dc:creator>Steve Colbert</dc:creator>
      <dc:date>2001-05-15T14:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: #define compiler problem still occurring - still an hpux newbie</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528656#M728651</link>
      <description>did you verify that there are no whitspace charactes after the backslashes? Use ":set list" in vi to see them. The lines must end with "\$", where "$" represents the NL line terminator.</description>
      <pubDate>Tue, 15 May 2001 15:15:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528656#M728651</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-05-15T15:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: #define compiler problem still occurring - still an hpux newbie</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528657#M728652</link>
      <description>Hi Steve,&lt;BR /&gt;I running Version A.3.30 of aCC and everything worked fine.&lt;BR /&gt;&lt;BR /&gt;I defined a macro like this:&lt;BR /&gt;&lt;BACKSLASH&gt; denotes a single backslash character at the end of the line (no trailing spaces)&lt;BR /&gt;&lt;BR /&gt;#define swap(a,b,temp) &lt;BACKSLASH&gt;&lt;BR /&gt;{ &lt;BACKSLASH&gt;&lt;BR /&gt;  temp = a; &lt;BACKSLASH&gt;&lt;BR /&gt;  a = b; &lt;BACKSLASH&gt;&lt;BR /&gt;  b = temp; &lt;BACKSLASH&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Then in the main:&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int aa = -1,bb = 1,cc = 0;&lt;BR /&gt;&lt;BR /&gt;  printf("Hello world\n");&lt;BR /&gt;  swap(aa,bb,cc);&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;when I did an aCC -P myfile.c I got a myfile.i&lt;BR /&gt;which looked like this:&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int aa = -1,bb = 1,cc = 0;&lt;BR /&gt;  printf("Hello world\n");&lt;BR /&gt;  { cc = aa; aa = bb; bb = cc};&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Exactly what you would expect; you might try upgrading to the 3.30 version but I would also&lt;BR /&gt;create a macro exactly like the one above first as a test. There may be an upper limit to the length of a multi-line macro but I have used some fairly large ones (&amp;gt; 300 chars) without problems.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;</description>
      <pubDate>Tue, 15 May 2001 15:30:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528657#M728652</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-15T15:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: #define compiler problem still occurring - still an hpux newbie</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528658#M728653</link>
      <description>Thanks to all.  &lt;BR /&gt;&lt;BR /&gt;The problem turned out to be characters after the continuation backslash.  Our source is originally written on MS clients and stored to VSS.  MS puts CR/LF at end of line.  Unix is only LF.  I was getting the extra CR character after the continuation character.  &lt;BR /&gt;&lt;BR /&gt;Thanks to all for the help!!!</description>
      <pubDate>Tue, 15 May 2001 17:32:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/define-compiler-problem-still-occurring-still-an-hpux-newbie/m-p/2528658#M728653</guid>
      <dc:creator>Steve Colbert</dc:creator>
      <dc:date>2001-05-15T17:32:07Z</dc:date>
    </item>
  </channel>
</rss>

