diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 8 | ||||
-rw-r--r-- | lib/Makefile.in | 6 | ||||
-rw-r--r-- | lib/ignore-value.h | 45 |
3 files changed, 55 insertions, 4 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 906cdb0..e0f95a2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl --no-vc-files base64 cond thread +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl --no-vc-files base64 cond ignore-value thread AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects @@ -91,6 +91,12 @@ EXTRA_DIST += $(top_srcdir)/config/config.rpath ## end gnulib module havelib +## begin gnulib module ignore-value + +libgnu_la_SOURCES += ignore-value.h + +## end gnulib module ignore-value + ## begin gnulib module lock libgnu_la_SOURCES += glthread/lock.h glthread/lock.c diff --git a/lib/Makefile.in b/lib/Makefile.in index d5b3b48..3ebf543 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -23,7 +23,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl --no-vc-files base64 cond thread +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl --no-vc-files base64 cond ignore-value thread @@ -309,8 +309,8 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = libgnu_la_SOURCES = base64.h base64.c glthread/cond.h glthread/cond.c \ - glthread/lock.h glthread/lock.c glthread/thread.h \ - glthread/thread.c glthread/threadlib.c + ignore-value.h glthread/lock.h glthread/lock.c \ + glthread/thread.h glthread/thread.c glthread/threadlib.c libgnu_la_LIBADD = $(gl_LTLIBOBJS) libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) EXTRA_libgnu_la_SOURCES = gettimeofday.c diff --git a/lib/ignore-value.h b/lib/ignore-value.h new file mode 100644 index 0000000..5f97c91 --- /dev/null +++ b/lib/ignore-value.h @@ -0,0 +1,45 @@ +/* ignore a value to quiet a compiler warning + + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) +# endif +#endif + +/* Use this function to avoid a warning when using a function declared with + gcc's warn_unused_result attribute, but for which you really do want to + ignore the result. Traditionally, people have used a "(void)" cast to + indicate that a function's return value is deliberately unused. However, + if the function is declared with __attribute__((warn_unused_result)), + gcc issues a warning even with the cast. + + Caution: most of the time, you really should heed gcc's warning, and + check the return value. However, in those exceptional cases in which + you're sure you know what you're doing, use this function. + + For the record, here's one of the ignorable warnings: + "copy.c:233: warning: ignoring return value of 'fchown', + declared with attribute warn_unused_result". */ + +static inline void +ignore_value (int i __attribute__ ((__unused__))) +{ + /* empty */ +} |