<?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: aCC difference between preprocessor and compiler in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884236#M704471</link>
    <description>Greg,&lt;BR /&gt;&lt;BR /&gt;aCC -P does NOT compile but only preprocesses...&lt;BR /&gt;&lt;BR /&gt;What exactly do you want to do?&lt;BR /&gt;&lt;BR /&gt;++Cyrille</description>
    <pubDate>Sat, 05 Feb 2005 13:58:11 GMT</pubDate>
    <dc:creator>MAUCCI_2</dc:creator>
    <dc:date>2005-02-05T13:58:11Z</dc:date>
    <item>
      <title>aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884235#M704470</link>
      <description>Version aCC A.03.56&lt;BR /&gt;Example:&lt;BR /&gt;file test.cpp&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;#define A2U(x) L#x&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;&lt;BR /&gt;Run: aCC -P test.cpp&lt;BR /&gt;Preprocessor result (test.i):&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = L"TEST" ;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;No error if this result is compiling.&lt;BR /&gt;&lt;BR /&gt;Run: aCC test.cpp&lt;BR /&gt;Result: 2 errors&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;Error 172: "test.cpp", line 5 # Undeclared variable 'L'.&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;^^^ &lt;BR /&gt;Error 20: "test.cpp", line 5 # ';' expected before '"TEST"'.&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;^^^ &lt;BR /&gt;#--------------------------------------&lt;BR /&gt;&lt;BR /&gt;It looks like the result of preprocessor and compiler is different. Can anybody help me to avoid this problem?&lt;BR /&gt;&lt;BR /&gt;In previous aCC releases (3.27) there was problem in preprocessor also. For above example the result was &lt;BR /&gt;&lt;BR /&gt;wchar_t* p = L “TEST” ;&lt;BR /&gt;// There is 1 space symbol between L and “TEST”.&lt;BR /&gt; &lt;BR /&gt;Now the preprocessor is seems to be working correctly. What about compiler? Is that correct behav</description>
      <pubDate>Fri, 04 Feb 2005 19:07:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884235#M704470</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-04T19:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884236#M704471</link>
      <description>Greg,&lt;BR /&gt;&lt;BR /&gt;aCC -P does NOT compile but only preprocesses...&lt;BR /&gt;&lt;BR /&gt;What exactly do you want to do?&lt;BR /&gt;&lt;BR /&gt;++Cyrille</description>
      <pubDate>Sat, 05 Feb 2005 13:58:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884236#M704471</guid>
      <dc:creator>MAUCCI_2</dc:creator>
      <dc:date>2005-02-05T13:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884237#M704472</link>
      <description>You may find it useful to preprocess the source to a file.  This will probably make it easier to determine what the compiler is complaining about.</description>
      <pubDate>Sun, 06 Feb 2005 21:06:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884237#M704472</guid>
      <dc:creator>Daavid Turnbull</dc:creator>
      <dc:date>2005-02-06T21:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884238#M704473</link>
      <description>That is what I'm talking about. The result of preprocessor differs from what compiler uses for compilation. When preprocessor gives correct result (the source code outputted by preprocessor is compiled successfully) compiler complains on some errors. The example: try to use L macro in define (see example above). Preprocessor outputs correct result where A2U(TEST) is converted to L"TEST". But compiler complains on "undeclared variable L". I noticed such problem when I started work with aCC 3.27. The preprocessor on this version outputs A2U(TEST) as L "TEST" (L plus SPACE plus "TEST"). And the error of "undeclared variable L" is obvious. So, I suppose this is not correct behavior. And it was fixed in preprocessor of 3.56 but not in compiler. My question is : is there any workaround to pass it over?</description>
      <pubDate>Mon, 07 Feb 2005 02:20:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884238#M704473</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-07T02:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884239#M704474</link>
      <description>Do you really believe this pre-processed code to be valid c++ code?&lt;BR /&gt;&lt;BR /&gt;-Cyrille&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = L"TEST" ;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Feb 2005 02:28:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884239#M704474</guid>
      <dc:creator>MAUCCI_2</dc:creator>
      <dc:date>2005-02-07T02:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884240#M704475</link>
      <description>OK, I don't know if your code is valid or not, but I know see your point, and you may have expressed it this way to be more clear:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[08:37:57]:attend:/home/pack&lt;BR /&gt;cmaucci&amp;gt; aCC -E -.i a.cpp&lt;BR /&gt;[08:37:59]:attend:/home/pack&lt;BR /&gt;cmaucci&amp;gt; cat a.i         &lt;BR /&gt;#line 1 "a.cpp"&lt;BR /&gt;&lt;BR /&gt;#line 2 "a.cpp"&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = L"TEST" ;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;[08:38:03]:attend:/home/pack&lt;BR /&gt;cmaucci&amp;gt; aCC a.i         &lt;BR /&gt;Warning 829: "a.cpp", line 4 # Implicit conversion of string literal to 'wchar_t *' is deprecated.&lt;BR /&gt;    wchar_t* p = L"TEST" ;&lt;BR /&gt;                 ^^^^^^^  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IN 2 STEPS THIS HAS COMPILED!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[08:38:06]:attend:/home/pack&lt;BR /&gt;cmaucci&amp;gt; aCC a.cpp       &lt;BR /&gt;Error 172: "a.cpp", line 4 # Undeclared variable 'L'.&lt;BR /&gt;    wchar_t* p = A2U(TEST);&lt;BR /&gt;                 ^^^       &lt;BR /&gt;Error 20: "a.cpp", line 4 # ';' expected before '"TEST"'.&lt;BR /&gt;    wchar_t* p = A2U(TEST);&lt;BR /&gt;                 ^^^       &lt;BR /&gt;[08:38:11]:attend:/home/pack&lt;BR /&gt;cmaucci&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IN 1 STEP THIS HAS NOT COMPILED&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Feb 2005 02:34:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884240#M704475</guid>
      <dc:creator>MAUCCI_2</dc:creator>
      <dc:date>2005-02-07T02:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884241#M704476</link>
      <description>Yes, this is some kind of workaround I tried to use but it doesn't work for me. Thank you anyway.</description>
      <pubDate>Mon, 07 Feb 2005 12:58:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884241#M704476</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-07T12:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884242#M704477</link>
      <description>What about the following slightly amended version?&lt;BR /&gt;&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;#define A2U(x) L ## #x&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;#--------------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 04:22:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884242#M704477</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-02-09T04:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884243#M704478</link>
      <description>Stephen,&lt;BR /&gt;&lt;BR /&gt;This example can not be compiled. Compiler returns 4 errors... &lt;BR /&gt;Also preprocessor returns result as&lt;BR /&gt;wchar_t* p = L#TEST ; &lt;BR /&gt;It seems like preprocessor can not make one more step - to substitute "TEST" instead of #TEST. &lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 13:06:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884243#M704478</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-09T13:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884244#M704479</link>
      <description>I'm assuming that the '#--------' lines aren't actually in the C code?&lt;BR /&gt;&lt;BR /&gt;If you are sure that the macro definition reads&lt;BR /&gt;&lt;BR /&gt;#define&lt;SPACE&gt;A2U(x)&lt;SPACE&gt;L&lt;SPACE&gt;##&lt;SPACE&gt;#x&lt;BR /&gt;&lt;BR /&gt;then your compiler is definitely wrong! There is nothing wrong with the syntax. I've checked it on 3 different compilers and they are all happy with it. Is your aCC patched to the latest level? &lt;BR /&gt;&lt;BR /&gt;One kludge you might also try is:&lt;BR /&gt;&lt;BR /&gt;#define CONCAT(x,y) x ## y&lt;BR /&gt;#define A2U(x) CONCAT(L,#x)&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Worth a try!&lt;BR /&gt;&lt;BR /&gt;&lt;/SPACE&gt;&lt;/SPACE&gt;&lt;/SPACE&gt;&lt;/SPACE&gt;</description>
      <pubDate>Thu, 10 Feb 2005 04:10:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884244#M704479</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-02-10T04:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884245#M704480</link>
      <description>Now that I know what you wanna do&lt;BR /&gt;&lt;BR /&gt;#define A2U(x) L##x&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U("TEST");&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;perfectly compiles on aCC 3.60&lt;BR /&gt;&lt;BR /&gt;Cyrille</description>
      <pubDate>Thu, 10 Feb 2005 04:30:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884245#M704480</guid>
      <dc:creator>MAUCCI_2</dc:creator>
      <dc:date>2005-02-10T04:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884246#M704481</link>
      <description>#define A2U(x) L##"x"&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;also works</description>
      <pubDate>Thu, 10 Feb 2005 04:31:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884246#M704481</guid>
      <dc:creator>MAUCCI_2</dc:creator>
      <dc:date>2005-02-10T04:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884247#M704482</link>
      <description>#define A2U(x) L##"x"&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Doesn't work on all compilers. You end up (on some compilers) with&lt;BR /&gt;&lt;BR /&gt;wchar_t* p = L"x"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Feb 2005 05:11:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884247#M704482</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-02-10T05:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884248#M704483</link>
      <description>Stephen,&lt;BR /&gt;&lt;BR /&gt;Your variant &lt;BR /&gt;&lt;BR /&gt;#define CONCAT(x,y) x ## y&lt;BR /&gt;#define A2U(x) CONCAT(L,#x)&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;works perfect. Thank you very much.</description>
      <pubDate>Thu, 10 Feb 2005 12:49:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884248#M704483</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-10T12:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884249#M704484</link>
      <description>Cyrille,&lt;BR /&gt;&lt;BR /&gt;wchar_t* p = A2U("TEST"); would not work in all cases because sometime you may want to use x in macro to create variable assosiated with it. Somethink like m_x = L"x". Thank you anyway.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Feb 2005 12:52:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884249#M704484</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-10T12:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: aCC difference between preprocessor and compiler</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884250#M704485</link>
      <description>The final solution:&lt;BR /&gt;&lt;BR /&gt;#define CONCAT(x,y) x ## y&lt;BR /&gt;#define A2U(x) CONCAT(L,#x)&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt;wchar_t* p = A2U(TEST);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Provided by Stephen Keane</description>
      <pubDate>Thu, 10 Feb 2005 12:55:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-difference-between-preprocessor-and-compiler/m-p/4884250#M704485</guid>
      <dc:creator>Gregory Kryltsov</dc:creator>
      <dc:date>2005-02-10T12:55:05Z</dc:date>
    </item>
  </channel>
</rss>

