IAR AVR 5.40 warning

Hello I compiler freeRTOS demo project for AVR with IAR ver 5.40 ,but the compiler generates 1 warning at line 422 of tasks.c file:
pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( unsigned long ) pxTopOfStack ) & ( ( unsigned long )  portBYTE_ALIGNMENT_MASK  ) ); this is warning message of compiler:
Warning: conversion from integer to smaller pointer E:freeRTOS_AVRProjfreeRTOStasks.c 422 Please help me to edit this line and file for removing this warning. best regards
Zal

IAR AVR 5.40 warning

Try changing the tow (unsigned long) casts to (unsigned portSTACK_TYPE) or just (portSTACK_TYPE) if it is already unsigned. Post back if this works or not.

IAR AVR 5.40 warning

The above change will not work ! please help me Mr barry.

IAR AVR 5.40 warning

To solve it you can cast to unsigned int instead of unsigned long, it works and it should be correct because pointers are two bytes in size, as so the correct cast is to a two-byte wide type.