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

__attribute__((warn_unused_result))

From: Joe Orton <jorton_at_redhat.com>
Date: 2004-04-06 14:35:53 CEST

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
svn_error_create{,f}:

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
       (SVN_ERR_FS_REP_NOT_MUTABLE, NULL,
        "Rep '%s' is not mutable", rep_key);
 

---------------------------------------------------------------------
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:36:18 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.