<?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: error: expected an expression in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782662#M641007</link>
    <description>&amp;gt;When I use the below options, it is throwing "too many arguments for the macro" at many places.&lt;BR /&gt;&amp;gt;-E -.i +legacy_cpp -Wp,-C,-G&lt;BR /&gt;&lt;BR /&gt;Did it still produce a .i file?  If not, you need to switch to a different hammer:&lt;BR /&gt;-Wc,-L,atk_db.macro&lt;BR /&gt;&lt;BR /&gt;Then scan atk_db.macro for P_realloc.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;instead of defining it in another file and including it here&lt;BR /&gt;&lt;BR /&gt;Does -H show you are including that other file?</description>
    <pubDate>Wed, 04 May 2011 08:10:36 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-05-04T08:10:36Z</dc:date>
    <item>
      <title>error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782652#M640997</link>
      <description>While migrating one of our app from Solaris to HP-UX, I am getting an error:&lt;BR /&gt;&lt;BR /&gt;"./src/atk_db.pc", line 679: error #2029: expected an expression&lt;BR /&gt;STR_CAT_ALLOC(ps_query, ps_clause);&lt;BR /&gt;^ &lt;BR /&gt;&lt;BR /&gt;Note: The above code had been running fine on Sun OS 5.8.&lt;BR /&gt;&lt;BR /&gt;The macro definitions are given below:&lt;BR /&gt;&lt;BR /&gt;#define IS_NULL( x )      ((x) == NULL)&lt;BR /&gt;#define IS_EMPTY_STRING( x ) (IS_NULL( (x) ) || ((x)[0] == 0))&lt;BR /&gt;#define SAFE_STRING( s )   (!IS_NULL((s)) ? (s) : "")&lt;BR /&gt;&lt;BR /&gt;#define P_FREE( x ) \&lt;BR /&gt;if ( (x) ) { \&lt;BR /&gt;  P_free( (x) ); \&lt;BR /&gt;  (x) = NULL; \&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#define STR_COPY_ALLOC( d, s ) \&lt;BR /&gt;if ( (d) ) { \&lt;BR /&gt;  P_FREE( (d) ); \&lt;BR /&gt;} \&lt;BR /&gt;(d) = P_newstr( P_string_va_length(SAFE_STRING((s)), NULL) + 1 ); \&lt;BR /&gt;P_string_copy( (d), P_string_va_length(SAFE_STRING((s)), NULL) + 1, SAFE_STRING((s)) );&lt;BR /&gt;&lt;BR /&gt;#define STR_CAT_ALLOC( d, s ) \&lt;BR /&gt;if ( (d) ) { \&lt;BR /&gt;  (d) = P_realloc( (d), P_string_va_length(SAFE_STRING((s)), SAFE_STRING((d)), NULL) + 1, char ); \&lt;BR /&gt;  P_string_concat( (d), P_string_va_length(SAFE_STRING((s)), SAFE_STRING((d)), NULL) + 1, SAFE_STRING((s)) ); \&lt;BR /&gt;} else { \&lt;BR /&gt;  STR_COPY_ALLOC( (d), (s) ); \&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;If anyone could shed light on this, it would be greatly helpful.</description>
      <pubDate>Fri, 29 Apr 2011 09:59:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782652#M640997</guid>
      <dc:creator>rajeshmsr</dc:creator>
      <dc:date>2011-04-29T09:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782653#M640998</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] from Solaris to HP-UX, [...]&lt;BR /&gt;&lt;BR /&gt;Using which compilers?&lt;BR /&gt;&lt;BR /&gt;If you could provide a small (but complete)&lt;BR /&gt;test case, then it would be easier to&lt;BR /&gt;investigate the right problem.&lt;BR /&gt;&lt;BR /&gt;Most compilers (for UNIX) have a "-E" option&lt;BR /&gt;to let you see what the preprocessor puts&lt;BR /&gt;out.  That might reveal something&lt;BR /&gt;interesting.</description>
      <pubDate>Fri, 29 Apr 2011 10:56:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782653#M640998</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-04-29T10:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782654#M640999</link>
      <description>What version of aC++ are you using?&lt;BR /&gt;&lt;BR /&gt;As Steven mentioned, you should inspect the .i file output by adding these options: -E -.i&lt;BR /&gt;&lt;BR /&gt;Or you could do:&lt;BR /&gt;cc ... +legacy_cpp&lt;BR /&gt;This will use the off chip preprocessor before compiling and the compiler will point to the errors in the expanded source.</description>
      <pubDate>Fri, 29 Apr 2011 22:24:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782654#M640999</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-04-29T22:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782655#M641000</link>
      <description>Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;Now spotted the exact location of the error:(its pointing at the char keyword)&lt;BR /&gt;&lt;BR /&gt;"./src/atk_db.pc", line 686: error #2029: expected an expression&lt;BR /&gt;(ps_query) = P_realloc( (ps_query), P_string_va_length((!((((ps_clause))) == 0L) ? ((ps_clause)) : ""), (!((((ps_query))) == 0L) ? ((ps_query)) : ""), 0L) + 1,char );&lt;BR /&gt;              ^&lt;BR /&gt;The char is passed to calculate the size to be allocated.&lt;BR /&gt;&lt;BR /&gt;The macro definition is given below.&lt;BR /&gt;&lt;BR /&gt;#define P_realloc(P, N, T) \&lt;BR /&gt;  (T *)P_mem_manage((void *)(P), (N) * sizeof(T), P_MEM_MALLOCTRY, \&lt;BR /&gt;      P_MEM_MALLOCDELAY, FALSE)&lt;BR /&gt;&lt;BR /&gt;Please suggest a solution.</description>
      <pubDate>Sat, 30 Apr 2011 06:31:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782655#M641000</guid>
      <dc:creator>rajeshmsr</dc:creator>
      <dc:date>2011-04-30T06:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782656#M641001</link>
      <description>&amp;gt;Now spotted the exact location of the error: (it's pointing at the char keyword)&lt;BR /&gt;&lt;BR /&gt;What did you change so that it is pointing to a new line?&lt;BR /&gt;What does the .i file show for that line?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The macro definition is given below.&lt;BR /&gt;&lt;BR /&gt;Is that macro defined before its use?</description>
      <pubDate>Sat, 30 Apr 2011 21:20:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782656#M641001</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-04-30T21:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782657#M641002</link>
      <description>I didn't change the code. I generated the preprocessed file(.i file) by using the -E -.i option and then compiled the preprocessed file (i.e., the .i file). In that file, it is showing the error:&lt;BR /&gt;"./src/atk_db.pc", line 686: error #2029: expected an expression&lt;BR /&gt;(ps_query) = P_realloc( (ps_query), P_string_va_length((!((((ps_clause))) == 0L) ? ((ps_clause)) : ""), (!((((ps_query))) == 0L) ? ((ps_query)) : ""), 0L) + 1,char );&lt;BR /&gt;^&lt;BR /&gt;&lt;BR /&gt;Note:The P_realloc is a macro. Even after preprocessing, this macro is not expanded. I have pasted the definition of the macro:&lt;BR /&gt;&lt;BR /&gt;#define P_realloc(P, N, T) \&lt;BR /&gt;(T *)P_mem_manage((void *)(P), (N) * sizeof(T), P_MEM_MALLOCTRY, \&lt;BR /&gt;P_MEM_MALLOCDELAY, FALSE)</description>
      <pubDate>Mon, 02 May 2011 04:08:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782657#M641002</guid>
      <dc:creator>rajeshmsr</dc:creator>
      <dc:date>2011-05-02T04:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782658#M641003</link>
      <description>Edit: The macro is defined before it's use.</description>
      <pubDate>Mon, 02 May 2011 11:06:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782658#M641003</guid>
      <dc:creator>rajeshmsr</dc:creator>
      <dc:date>2011-05-02T11:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782659#M641004</link>
      <description>&amp;gt;The macro is defined before its use.&lt;BR /&gt;&lt;BR /&gt;You need to use a bigger debugging hammer:&lt;BR /&gt;-E -.i +legacy_cpp -Wp,-C,-G&lt;BR /&gt;&lt;BR /&gt;Then scan the .i file for P_realloc.</description>
      <pubDate>Mon, 02 May 2011 18:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782659#M641004</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-05-02T18:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782660#M641005</link>
      <description>When I use the below options, it is throwing "too many arguments for the macro" at many places.&lt;BR /&gt;-E -.i +legacy_cpp -Wp,-C,-G&lt;BR /&gt;&lt;BR /&gt;Temporary Fix: When I define the below macro in the source file itself, (instead of defining it in another file and including it here), the error is disappears.&lt;BR /&gt;&lt;BR /&gt;#define P_realloc(P, N, T) (T *)P_mem_manage((void *)(P), (N) * sizeof(T), P_MEM_MALLOCTRY, P_MEM_MALLOCDELAY, FALSE)</description>
      <pubDate>Wed, 04 May 2011 04:20:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782660#M641005</guid>
      <dc:creator>rajeshmsr</dc:creator>
      <dc:date>2011-05-04T04:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782661#M641006</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Temporary Fix: When I define the below&lt;BR /&gt;&amp;gt; macro in the source file itself, (instead&lt;BR /&gt;&amp;gt; of defining it in another file and&lt;BR /&gt;&amp;gt; including it here), the error is&lt;BR /&gt;&amp;gt; disappears.&lt;BR /&gt;&lt;BR /&gt;In my (limited) experience, C preprocessors&lt;BR /&gt;often care what they read, and in which&lt;BR /&gt;order, but they seldom care which file the&lt;BR /&gt;directives came from.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; If you could provide a small (but complete)&lt;BR /&gt;&amp;gt; test case, then it would be easier to&lt;BR /&gt;&amp;gt; investigate the right problem.&lt;BR /&gt;&lt;BR /&gt;Still true.</description>
      <pubDate>Wed, 04 May 2011 05:24:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782661#M641006</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-05-04T05:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: error: expected an expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782662#M641007</link>
      <description>&amp;gt;When I use the below options, it is throwing "too many arguments for the macro" at many places.&lt;BR /&gt;&amp;gt;-E -.i +legacy_cpp -Wp,-C,-G&lt;BR /&gt;&lt;BR /&gt;Did it still produce a .i file?  If not, you need to switch to a different hammer:&lt;BR /&gt;-Wc,-L,atk_db.macro&lt;BR /&gt;&lt;BR /&gt;Then scan atk_db.macro for P_realloc.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;instead of defining it in another file and including it here&lt;BR /&gt;&lt;BR /&gt;Does -H show you are including that other file?</description>
      <pubDate>Wed, 04 May 2011 08:10:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-expected-an-expression/m-p/4782662#M641007</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-05-04T08:10:36Z</dc:date>
    </item>
  </channel>
</rss>

