Bug 87396 - ada/gcc-interface/decl.c:8798:53:Value Conversion Issue: implicit conversion from 'int' to 'char' changes value from 132 to -124: -Wconstant-conversion
Summary: ada/gcc-interface/decl.c:8798:53:Value Conversion Issue: implicit conversion ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Eric Botcazou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-23 18:18 UTC by Martin Liška
Modified: 2018-09-24 10:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-09-24 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2018-09-23 18:18:30 UTC
Maybe it's a relevant warning for Ada FE:

  8795    /* Only issue an error if a Value_Size clause was explicitly given.
  8796       Otherwise, we'd be duplicating an error on the Size clause.  */
  8797    gnat_attr_node
  8798      = Get_Attribute_Definition_Clause (gnat_entity, Attr_Value_Size);
  8799  
  8800    /* Get the size as an INTEGER_CST.  Issue an error if a size was specified
  8801       but cannot be represented in bitsizetype.  */
  8802    size = UI_To_gnu (uint_size, bitsizetype);
  8803    if (TREE_OVERFLOW (size))
Comment 1 Eric Botcazou 2018-09-24 07:58:06 UTC
We should probably be converting to 'unsigned char' instead.
Comment 2 Eric Botcazou 2018-09-24 10:29:39 UTC
Author: ebotcazou
Date: Mon Sep 24 10:29:07 2018
New Revision: 264525

URL: https://gcc.gnu.org/viewcvs?rev=264525&root=gcc&view=rev
Log:
	PR ada/87396
	* fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
	of 'char' as the type of the second parameter.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/fe.h
Comment 3 Eric Botcazou 2018-09-24 10:30:38 UTC
.