>From GCC 4.3 onwards you can use -Wconversion. test.c: In function 'main': test.c:16: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value Previous versions have a Wconversion option but it won't do what you want even if you think it does. Read more here: http://gcc.gnu.org/wiki/NewWconversion Cheers, Manuel.