On 18.01.2011, at 17:25, Yuri P. Fedorchenko wrote:

>> 
>> This'll depend on what headers you have installed for glibc I guess, but
>> I doubt we can get rid of all the "declared with attribute
>> warn_unused_result" warnings unless we either alter the code, or maybe
>> there's some compiler option to tell gcc to just shut up about them?
>> 
>> Most of them are just noise from recent gcc/glibc versions...
>> 
>> I daresay they would argue that the warnings are helpful, but I remain
>> unconvinced!
>> 
> 
> I want to tell that not all warning are needed to suppress. I think that for 
> examle commit "[Library] r8275 - branches/branch-1.3/FL" seams strange for me
> 
> one of changes.
> -  virtual const char *item_text(void *item) const { return 0L; }
> +  virtual const char *item_text(void *item) const { (void)item; return 0L; }
> 
> i don't understand reasons for this patch

It is always useful to suppress all warnings. It makes you much more alert when 
a new warning pops up.

The line above throws a warning the "item" is not used, even though it is 
declared. Normally, we would not declare it, but doxygen wants a name here. To 
fool the compiler into thinking we used the argument, he added the statement 
"(void)item;" which doesn't do a thing and doesn't generate code either, but 
tells the compiler that there is no reason to warn.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to