Why gcc4 warn and how to avoid it
- by vitaly.v.ch
I have a function declared as:
void event_add_card (EventAddr addr, EventType type, unsigned char card);
and union
typedef union EventData
{
float money; /**< money info */
unsigned char card; /**< new card */
}
EventData;
When i compile following code:
EventData data = {};
event_add_card (0,0, data.card);
with enabled warning -Wconversion I receive following warning:
player-stud.c|71| warning: passing argument 3 of 'event_add_card' with different width due to prototype
Why gcc4 unsuccessful and how to fix It???