[AD] warn_unused_result GCC attribute?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I second the first and the second idea.  Deffinetely
musts.

--- Chris wrote:
> From: Chris <chris.kcat@xxxxxxxxxx>
> To: alleg-developers@xxxxxxxxxx
> Subject: [AD] warn_unused_result GCC attribute?
> Date: Sat, 19 Mar 2005 19:28:14 -0800
> 
> I ran across this while compiling my new 2.6 kernel.
> Apparently GCC has 
> a warn_unused_result attribute that produces a
> warning when the return 
> value of a function isn't used (checked or put into
> a variable).
> 
> I don't know what version of GCC introduced it, but
> I think it'd be 
> useful for things like install_allegro,
> set_gfx_mode, etc.. which you 
> should always check. Normally I wouldn't really like
> the extra warnings, 
> but considering the number of newbs that neglect
> return values, and even 
> experienced programmers that can let them slip by in
> error, it might be 
> better to add it.
> 
> I would also like to suggest going through the GCC
> manual and finding 
> useful function, variable, and type attributes and
> adding them where 
> appropriate, for optimization purposes. Though
> perhaps this could wait 
> and just add them as the new API is written up.
> 
> The page for function attributes is here:
>
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Function-Attributes.html#Function-Attributes
> It contains links to the variable and type attribute
> pages.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/