From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trevor Yann To: help-gcc@gnu.org Subject: How to warn about possibly truncated values? Date: Tue, 30 Nov 1999 23:28:00 -0000 Message-ID: <38335D56.547F0511@vet.com.au> X-SW-Source: 1999-11n/msg00267.html Message-ID: <19991130232800.VqUFmvjWCzWhCp4JX9x6W524A4ROS08Zz_JqznwrV7k@z> In the following code it is possible that the assignment of x will result in the value being truncated. Is there a way to get gcc to warn about this code? extern unsigned long g(void); unsigned short f(void) { unsigned short x = g(); return x; }