<?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>Urgent: warning:  #61-D: integer operation result is out of range</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/22351/urgent-warning-61-d-integer-operation-result-is-out-of-range</link><description> 
HI Friends, 

 
I am using AT91SAM7SE512 controller, 
i have configured the input in port B.while compiling the program i
am getting this warning. 

 
main.c(8): warning: #61-D: integer operation result is out of
range 
main.c(8): warning: #68-D: integer</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Urgent: warning:  #61-D: integer operation result is out of range</title><link>https://community.arm.com/thread/113216?ContentTypeID=1</link><pubDate>Sun, 16 Sep 2007 20:53:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a5c683a2-fe3a-4bfe-a120-b319513889bb</guid><dc:creator>Murthy r</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank you very much dear friend.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Urgent: warning:  #61-D: integer operation result is out of range</title><link>https://community.arm.com/thread/99647?ContentTypeID=1</link><pubDate>Sat, 15 Sep 2007 01:57:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c4608cfb-f270-4645-a903-e2e5c3256bc2</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
A 32-bit integer has exactly what out sounds like - 32 bits. They
are numbered from 0 to 31, and for an unsigned integer represents the
values 2^0 (=1) to 2^31 (=2147483648).&lt;/p&gt;

&lt;p&gt;
For a signed integer, a system called two&amp;#39;s complement is used.
Half the capacity is used to store negative values, limiting the
largest positive value to every bit &lt;b&gt;but&lt;/b&gt; the last one, i.e. 2^0
+ 2^1 + 2^2 + ... + 2^30 (=2147483647). A signed integer will the
most significant bit set represents a negative value.&lt;/p&gt;

&lt;p&gt;
Your operation (1&amp;lt;&amp;lt;31) would convert the positive number 1
into a negative value by moving the bit all the way into the last
position, and the compiler complained. Specifically saying that the
digit 1 was unsigned, by the suffix u (1u) tells the compiler that
the integer should not be treated as a signed integer and that the
most significant bit is available to be used without generating a
warning.&lt;/p&gt;

&lt;p&gt;
For more information about the two&amp;#39;s complement format, see this
link:&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Two"&gt;en.wikipedia.org/.../Two&lt;/a&gt;&amp;#39;s_complement&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Urgent: warning:  #61-D: integer operation result is out of range</title><link>https://community.arm.com/thread/75487?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2007 23:35:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2025a5b9-34a3-43cb-9ba3-ef3b2e6fc65b</guid><dc:creator>Murthy r</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi friend,&lt;/p&gt;

&lt;p&gt;
Thanks for your suggestion.&lt;/p&gt;

&lt;p&gt;
Now there is no warning.&lt;/p&gt;

&lt;p&gt;
May i know the reason for this declaration.&lt;br /&gt;
#define test ((unsigned long)1&amp;lt;&amp;lt;31) //PB31&lt;/p&gt;

&lt;p&gt;
because i declared other pins like this &amp;quot;#define test
(1&amp;lt;&amp;lt;20) //PB31&amp;quot;.For that no warnings,only the warning is giving
this PB31 pin.&lt;/p&gt;

&lt;p&gt;
Please advise.&lt;/p&gt;

&lt;p&gt;
with regards,&lt;br /&gt;
Nanju..&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Urgent: warning:  #61-D: integer operation result is out of range</title><link>https://community.arm.com/thread/48583?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2007 06:33:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6a2ea697-e1de-4031-bc2f-79cb3a76650d</guid><dc:creator>Robert &amp;#160;</dc:creator><description>&lt;p&gt;&lt;p&gt;
Declare &lt;i&gt;test&lt;/i&gt; as unsigned long:&lt;/p&gt;

&lt;pre&gt;
#define test (1UL&amp;lt;&amp;lt;31)
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>