Opened 7 years ago
Closed 2 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 Changed 6 years ago by
comment:2 Changed 2 years ago by
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: