This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16029] incorrect "unused variable" message from -Wall


------- Additional Comments From bangerth at dealii dot org  2004-06-17 00:20 -------
Well, that's error recovery: the compiler has to assume something when 
encountering an error, before going on. In this case, it assumes that 
'whatever' is a variable, and seems to tentatively inject a declaration 
of it. Since the 'return' statement was in error, it is apparently not 
considered a 'use' of this variable.  
 
I am tempted to close this PR since it really is a case where one shouldn't 
place too much emphasis on follow-up errors, given that the first error 
is already pretty clear. However, it may also be easy enough to change the 
compiler to mark all tentative variable and function declarations in error 
recovery with __attribute__((used)) to avoid this kind of follow-up. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-17 00:20:08
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16029


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]