This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
implicit cast from unsigned long to unsigned int gives no warning with -Wall (64 bits arch)
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: vtorri at univ-evry dot fr
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 22 Nov 2007 22:10:50 +0100
- Subject: implicit cast from unsigned long to unsigned int gives no warning with -Wall (64 bits arch)
>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.