Opened 8 years ago
Closed 3 years ago
#44 closed defect (invalid)
zero_t causes warnings because it always codgens as long int
| Reported by: | Rob Schluntz | Owned by: | |
|---|---|---|---|
| Priority: | minor | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | |
| Cc: |
Description
zero_t should intelligently codegen as long int, void *, or void (*)() depending on the context.
An example where this is necessary:
typedef void (*fptr_t)();
void f(int);
int main() {
fptr_t x;
x = f;
}
The assignment function is correctly chosen as
forall( ftype FT ) FT * ?=?( FT * &, zero_t );
But codegens as
((void)(__x__PF___2=((long int )__f__F_i__1)));
Which causes a warning in gcc:
warning: assignment makes pointer from integer without a cast
Change History (2)
comment:1 by , 7 years ago
comment:2 by , 3 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
The example code does not compile, fixing the code to compile still doesn't produce the warning.
Note:
See TracTickets
for help on using tickets.
The example code no longer compiles: