15004 – [3.4 Regression] [unit-at-a-time] no warning for unused paramater in static function (original) (raw)
Description Drea Pinski 2004-04-18 15:53:58 UTC
Since t is inlined and no longer even tried to be emitted anymore there is no unused paramater warning for t.
static int t(int i) { return 0; } int tt() { return t(0); }
Comment 1 Jan Hubicka 2004-04-18 21:14:49 UTC
Subject: Re: [3.4/3.5 Regression] [unit-at-a-time] no warning for unused paramater in static function
Do we realy want this to have warned? We never did so for C++ and it would be pretty expensive to throw all the function into backend just to get the warnings out. Perhaps we may want to have such warnings only for code that is really used...
Honza
Comment 2 Drea Pinski 2004-04-18 21:29:13 UTC
Yes we want this, as if the function is too big to be inlined the function is warned about but if it is okay to be inlined it will be inlined and not warned about which right now is causing a bootstrap failure on some targets as the warning only applies to some targets only. Maybe this warning needs to be done earlier for C and C++ in that needs to be moved into the front-end or moved so that goes through some of these warnings no matter what.
Comment 3 Wolfgang Bangerth 2004-04-18 22:31:43 UTC
From a user's perspective: yes, we want the warning. It is confusing if the warning depends on the inlining strategy or optimization flags. Besides this, the warning usually shows a real deficiency in user's code, which we certainly don't want to paper over just because we inline the function. W.
Comment 5 Drea Pinski 2004-04-29 00:17:42 UTC
Fixed on the mainline right now.
Comment 7 Jan Hubicka 2004-05-05 23:27:50 UTC
Commited a fix to 3.4 branch.