[Bug c/59022] New: Bogus "warning: conversion to 'short int' from 'int' may alter its value [-Wconversion]"
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 6 13:45:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59022
Bug ID: 59022
Summary: Bogus "warning: conversion to 'short int' from 'int'
may alter its value [-Wconversion]"
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
The following code gives with C (cc1) and C++ (cc1plus) and -Wconversion the
bogus warning:
test3.c:2:31: warning: conversion to 'short int' from 'int' may alter its value
[-Wconversion]
coordtmp[0] = coordexist[0] + coordexist[1];
^
void SetBins(short *coordexist, short *coordtmp) {
coordtmp[0] = coordexist[0] + coordexist[1];
}
The -fdump-tree-original dump looks as follows:
*coordtmp = (short int) ((unsigned short) *coordexist + (unsigned short)
*(coordexist + 2));
More information about the Gcc-bugs
mailing list