Discussion:
conversion warning bug?
Hariharan Sandanagobalane
2014-09-12 18:48:08 UTC
Permalink
Hello all,
I saw what i believe is a bug with -Wconversion option in GCC. Can
someone confirm? If it is a bug, i will file a bugzilla.


$gcc -S -O2 -Wconversion test2.c
test2.c: In function 'foo':
test2.c:5:8: warning: conversion to 'short int' from 'int' may alter
its value [-Wconversion]
a += b;
^


$more test2.c
short int a;

void foo (char b)
{
a += b;
}



$gcc --version
gcc (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Loading...