]> git.ipfire.org Git - thirdparty/coreutils.git/commit
maint: prefer attribute.h in .c files
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Nov 2021 05:30:38 +0000 (22:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Nov 2021 05:36:46 +0000 (22:36 -0700)
commit389e7663671e6dbd5644f6381d23f46f6d341339
tree1f1ffc9e4029cb55bc9895ee6dcf6c906024d68e
parentbafff0019cad471b69036ab0d6d1a80c9285583d
maint: prefer attribute.h in .c files

This will help us make the transition to C2x, where some
attributes must come at the start of function decls.
Leave the attributes alone in .h files for now,
as the Gnulib tradition is to not expose attribute.h to users.
* bootstrap.conf (gnulib_modules): Add ‘attribute’.
* gl/lib/randperm.c, src/make-prime-list.c, src/system.h:
Include attribute.h.
* gl/lib/strnumcmp.c (strnumcmp): Remove _GL_ATTRIBUTE_PURE here,
as this belongs in the .h file.
* gl/lib/strnumcmp.h (strnumcmp): Add _GL_ATTRIBUTE_PURE here.
* src/sort.c (human_numcompare, numcompare): Now ATTRIBUTE_PURE;
discovered due to strnumcmp.h change.
* gl/lib/randperm.c, src/copy.c, src/dd.c, src/df.c, src/digest.c:
* src/env.c, src/expr.c, src/factor.c, src/ls.c:
* src/make-prime-list.c, src/numfmt.c, src/od.c, src/pathchk.c:
* src/pinky.c, src/pr.c, src/ptx.c, src/realpath.c, src/relpath.c:
* src/seq.c, src/sort.c, src/stat.c, src/stty.c, src/system.h:
* src/tr.c, src/uniq.c, src/wc.c:
In .c files, crefer ATTRIBUTE_CONST to _GL_ATTRIBUTE_CONST, and
similarly for ATTRIBUTE_FORMAT and ATTRIBUTE_PURE.
* src/system.h (FALLTHROUGH): Remove; attribute.h defines it.
29 files changed:
bootstrap.conf
gl/lib/randperm.c
gl/lib/strnumcmp.c
gl/lib/strnumcmp.h
src/copy.c
src/dd.c
src/df.c
src/digest.c
src/env.c
src/expr.c
src/factor.c
src/ls.c
src/make-prime-list.c
src/numfmt.c
src/od.c
src/pathchk.c
src/pinky.c
src/pr.c
src/ptx.c
src/realpath.c
src/relpath.c
src/seq.c
src/sort.c
src/stat.c
src/stty.c
src/system.h
src/tr.c
src/uniq.c
src/wc.c