<?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>warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/27137/warning-1441-d-nonstandard-cast-on-lvalue</link><description> 
Hello guys, i am having this errore with the following code: 

 
startLinst(Timer_u *head){ Timer_u *ptr; 

 
(Timer_u *)ptr-&amp;gt;list1-&amp;gt;pnext = *head; 
} where head is the pointer to the head of a linked list. 

 
the ADT is: 
typedef union TIMER_U{ Timer4</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/139545?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 06:19:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b36a5807-fd23-48ea-927f-c60c357f432a</guid><dc:creator>PRAI LAPTOP</dc:creator><description>&lt;p&gt;&lt;p&gt;
I have removed the cast and the warning message is non more there
:)&lt;br /&gt;
thanks for you help.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/136114?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 06:12:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e4eac89c-4eff-4781-908e-c18ac8630940</guid><dc:creator>Mike Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;so I changed it in this way&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Yes, this new version of the code looks right.&lt;br /&gt;
What about the code that throws the warning? Is the warning still
there? Did you post the complete offending code?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/126108?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 06:06:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a345db9e-9a54-424d-8d5e-2cd91ca435f9</guid><dc:creator>PRAI LAPTOP</dc:creator><description>&lt;p&gt;&lt;p&gt;
you are right some infos are missing:&lt;br /&gt;
the ADT is defined in a header file, in the inverse order: i mean the
struct is defined before the union&lt;br /&gt;
this is the right order&lt;/p&gt;

&lt;pre&gt;
typedef struct TIMER1{
    unsigned char TimerID;
    unsigned char cnt;
    unsigned char processo:6; unsigned char type:2;
    union Timer_u *pnext;
}Timer1;

typedef struct TIMER2{...} Timer2;
typedef struct TIMER3{...} Timer3;
typedef struct TIMER4{...} Timer4;

typedef union TIMER_U{
    Timer4 *timer4;
    Timer3 *timer3;
    Timer2 *timer2;
    Timer1 *timer1;
}Timer_u;

&lt;/pre&gt;

&lt;p&gt;
so I changed it in this way&lt;/p&gt;

&lt;pre&gt;
union TIMER_U;
typedef struct TIMER1{
    unsigned char TimerID;
    unsigned char cnt;
    unsigned char processo:6; unsigned char type:2;
    union TIMER_U *pnext;
}Timer1;

typedef struct TIMER2{...} Timer2;
typedef struct TIMER3{...} Timer3;
typedef struct TIMER4{...}Timer4;

typedef union TIMER_U{
    Timer4 *timer4;
    Timer3 *timer3;
    Timer2 *timer2;
    Timer1 *timer1;
}Timer_u;

&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/115664?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 06:00:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2a2ffd1c-444d-4fc0-b0b8-65ec995e3f30</guid><dc:creator>Mike Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;removing the union I got the error &amp;quot;undefined class storage&amp;quot;,
so I put the code union TIMER_U before the definition of the structs
timer1/2/3/4 and this will make the compiler happy&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Isn&amp;#39;t it &amp;quot;undefined storage class&amp;quot; instead?&lt;br /&gt;
Besides, it seems to me it&amp;#39;s not the right way to make the compiler
happy. I think we&amp;#39;re not seeing the whole picture: the code you
posted is incomplete, it&amp;#39;s not clear in what order things are
declared and defined.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/102130?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 05:38:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4683936c-0062-4c94-8c92-90454d6e29a0</guid><dc:creator>PRAI LAPTOP</dc:creator><description>&lt;p&gt;&lt;p&gt;
Mike, thanks for the hint, but removing the union I got the error
&amp;quot;undefined class storage&amp;quot;, so I put the code&lt;br /&gt;
&lt;i&gt;union TIMER_U&lt;/i&gt; before the definition of the structs
timer1/2/3/4 and this will make the compiler happy.&lt;br /&gt;
this will we work in your opinion?&lt;/p&gt;

&lt;p&gt;
Jack, removing the cast I will get an error about an illegal
assignment.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/78233?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 05:18:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ae28c6cc-5d62-4ab9-bb46-0683c9ed5027</guid><dc:creator>Jack Sprat</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Can anyone help me to avoid the warning message 1441?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Remove the cast!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/90351?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 05:18:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bcf59daa-4f26-481b-978e-5dd208eb689a</guid><dc:creator>Mike Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
There is a typo in your code:&lt;/p&gt;

&lt;pre&gt;
union Timer_u *pnext;
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
The keyword &lt;b&gt;union&lt;/b&gt; shouldn&amp;#39;t be there. The compiler thinks that
you are referring to a different type defined elsewhere, rather than
to Timer_u.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/58035?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 05:02:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a4f72b82-202c-464d-97a1-a39ecb9cc866</guid><dc:creator>PRAI LAPTOP</dc:creator><description>&lt;p&gt;&lt;p&gt;
I will re-write the code:&lt;/p&gt;

&lt;pre&gt;
startLinst(Timer_u *head){
    Timer_u *ptr;

    (Timer_u *)ptr-&amp;gt;list1-&amp;gt;pnext = *head;
}
&lt;/pre&gt;

&lt;p&gt;
where head is the pointer to the head of a linked list.&lt;/p&gt;

&lt;p&gt;
the ADT is:&lt;/p&gt;

&lt;pre&gt;
typedef union TIMER_U{
    Timer4 *timer4;
    Timer3 *timer3;
    Timer2 *timer2;
    Timer1 *timer1;
}Timer_u;

typedef struct TIMER1{
    unsigned char TimerID;
    unsigned char cnt;
    unsigned char processo:6; unsigned char type:2;
    union Timer_u *pnext;
}Timer1;
&lt;/pre&gt;

&lt;p&gt;
Can anyone help me to avoid the warning message 1441?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/78232?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 04:59:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:61b0a6b3-cfe9-45bd-b59f-7fb0a3d6fc09</guid><dc:creator>PRAI LAPTOP</dc:creator><description>&lt;p&gt;&lt;p&gt;
i haven&amp;#39;t read it to be honest, I will rewrite it&lt;/p&gt;

&lt;p&gt;
sorry for the incovenience.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: warning:  #1441-D: nonstandard cast on lvalue</title><link>https://community.arm.com/thread/65556?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 04:54:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3e877e54-4639-4f61-9695-63eea0c2d079</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
The instructions for posting source code are quite clearly
stated:&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.danlhenry.com/caps/keil_code.png"&gt;www.danlhenry.com/.../keil_code.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
aren&amp;#39;t they?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>