<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>when I use  &amp;#39;#define DWORD   unsigned long&amp;#39; , why does the compiler give me a warning?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14602/when-i-use-define-dword-unsigned-long-why-does-the-compiler-give-me-a-warning</link><description> I use the following statement in my include file to define a new data type: 
#define DWORD unsigned long 
 
however, the compiler give me the following warning: 
Warnning C317:redefinition of macro &amp;#39;DWORD&amp;#39;. but i never defined it anywhere in my source</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: when I use  '#define DWORD   unsigned long' , why does the compiler give me a warning?</title><link>https://community.arm.com/thread/94925?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2002 13:25:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a3854b4c-a6cb-4299-b6be-e281b7e43b0b</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;1) cannot use typedef;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Why not?&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;2) after i change DWORD into UWORD, the warnning disappers!&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Of course it does - you are no longer in conflict with Keil&amp;#39;s &lt;b&gt;DWORD&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I still recommend that you should avoid &amp;quot;WORD&amp;quot; as it is ambiguous;&lt;br /&gt;
U32 tells you unambiguously (and fairly intuitively) that it&amp;#39;s &lt;b&gt;U&lt;/b&gt;nsigned and &lt;b&gt;32&lt;/b&gt; bits.&lt;br /&gt;
And it&amp;#39;s shorter to type into the bargain!  ;-)&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: when I use  '#define DWORD   unsigned long' , why does the compiler give me a warning?</title><link>https://community.arm.com/thread/54082?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2002 04:50:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1f16d4f2-60a4-4e96-ada3-be7ddc346393</guid><dc:creator>Yunfeng Lu</dc:creator><description>&lt;p&gt;1) cannot use typedef;&lt;br /&gt;
2) after i change DWORD into UWORD, the warnning disappers!&lt;br /&gt;
&lt;br /&gt;
thanks,&lt;br /&gt;
&lt;br /&gt;
Lu Yunfeng&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: when I use  '#define DWORD   unsigned long' , why does the compiler give me a warning?</title><link>https://community.arm.com/thread/54084?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2002 04:39:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:662dfbe1-22c2-4994-9525-f702b29aacfd</guid><dc:creator>Yunfeng Lu</dc:creator><description>&lt;p&gt;however, if i do not use DWORD, i cannot compile my source codes.!&lt;br /&gt;
&lt;br /&gt;
Lu Yunfeng&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: when I use  '#define DWORD   unsigned long' , why does the compiler give me a warning?</title><link>https://community.arm.com/thread/38230?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2002 03:26:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1d695ee6-b54e-4f82-8d40-4d0c7a155b1c</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;Read the section, &lt;i&gt;&amp;quot;Absolute Memory Access Macros&amp;quot;&lt;/i&gt; in the C51 manual!&lt;br /&gt;
&lt;br /&gt;
BTW: Why are you using &lt;b&gt;#define&lt;/b&gt; rather than &lt;b&gt;typedef&lt;/b&gt;?&lt;br /&gt;
&lt;br /&gt;
BTW2: I presume you&amp;#39;re doing this to get a compiler-independent 32-bit type?&lt;br /&gt;
However, the name &lt;i&gt;&amp;quot;DWORD&amp;quot;&lt;/i&gt; is ambiguous in this application; I would prefer to use a name like &lt;i&gt;&amp;quot;U32&amp;quot;&lt;/i&gt; (meaning, &amp;quot;&lt;b&gt;U&lt;/b&gt;nsigned &lt;b&gt;32&lt;/b&gt;-bit).&lt;br /&gt;
Just my opinion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: when I use  '#define DWORD   unsigned long' , why does the compiler give me a warning?</title><link>https://community.arm.com/thread/38232?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2002 02:08:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4765cef7-5e9e-4537-9e67-0ba523fe1c77</guid><dc:creator>changuel khemaies</dc:creator><description>&lt;p&gt;don&amp;#39;t use &lt;br /&gt;
#define DWORD unsigned long&lt;br /&gt;
&lt;br /&gt;
but use DWORD, i think that is pre-define type&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>