mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[qfcc] Allow implicit demotion in initializer elements
Notably, implicit double constants (no adorning d) being used to initialize float struct members.
This commit is contained in:
parent
65b48c734c
commit
4c2a6c9eb2
1 changed files with 4 additions and 0 deletions
|
@ -380,6 +380,10 @@ init_elements (struct def_s *def, expr_t *eles)
|
||||||
&& is_float (element->type)) {
|
&& is_float (element->type)) {
|
||||||
convert_int (c);
|
convert_int (c);
|
||||||
}
|
}
|
||||||
|
if (is_double (get_type (c)) && is_float (element->type)
|
||||||
|
&& c->implicit) {
|
||||||
|
convert_double (c);
|
||||||
|
}
|
||||||
if (get_type (c) != element->type) {
|
if (get_type (c) != element->type) {
|
||||||
error (c, "type mismatch in initializer");
|
error (c, "type mismatch in initializer");
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue