[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: __attribute__((warn_unused_result))

From: Branko Čibej <brane_at_xbc.nu>
Date: 2004-04-06 14:40:05 CEST

Joe Orton wrote:

>It would be interesting to apply this new gcc 3.4 function attribute to
>all functions which return an svn_error_t *; it might find some nice
>bugs. e.g. this looks obvious enough from just doing
>subversion/libsvn_fs/reps-strings.c: In function `rep_write':
>subversion/libsvn_fs/reps-strings.c:966: warning: ignoring return value
>of function declared with attribute warn_unused_result
>Index: subversion/libsvn_fs/reps-strings.c
>--- subversion/libsvn_fs/reps-strings.c (revision 9290)
>+++ subversion/libsvn_fs/reps-strings.c (working copy)
>@@ -963,7 +963,7 @@
> SVN_ERR (svn_fs__bdb_read_rep (&rep, fs, rep_key, trail));
> if (! rep_is_mutable (rep, txn_id))
>- svn_error_createf
>+ return svn_error_createf
> "Rep '%s' is not mutable", rep_key);

Heh, good catch! I wouldn't mind adding this to the sources, if it were
turned off by default (or possibly turned on by --enable-maintainer-mode
if configure detects GCC 3.4).

Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 6 14:40:32 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.