summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-03-15 09:19:10 +0100
committerJim Meyering <jim@meyering.net>2007-03-15 09:19:10 +0100
commit487e5317becff07b8c57763878bb293970816df5 (patch)
tree139a7f51b2aae216c64f8aea02197e525571c002
parent112b9537dda41e6bc9b18258ccb773be23bc6ce2 (diff)
downloadcoreutils-487e5317becff07b8c57763878bb293970816df5.tar.xz
Enforce policy: don't use *scanf functions.
* Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic. * .x-sc_prohibit_atoi_atof: Give stty a temporary pass. * TODO: note that stty.c needs this small clean-up.
-rw-r--r--.x-sc_prohibit_atoi_atof2
-rw-r--r--ChangeLog7
-rw-r--r--Makefile.maint6
-rw-r--r--TODO3
4 files changed, 15 insertions, 3 deletions
diff --git a/.x-sc_prohibit_atoi_atof b/.x-sc_prohibit_atoi_atof
index 3aaffb2b5..a0d15bac0 100644
--- a/.x-sc_prohibit_atoi_atof
+++ b/.x-sc_prohibit_atoi_atof
@@ -6,3 +6,5 @@ ChangeLog
^lib/euidaccess-stat\.c$
^lib/group-member\.c$
^Makefile\.maint$
+^doc/coreutils.texi$
+^src/stty.c$
diff --git a/ChangeLog b/ChangeLog
index 05bf2c806..2803f3f5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-15 Jim Meyering <jim@meyering.net>
+
+ Enforce policy: don't use *scanf functions.
+ * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
+ * .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
+ * TODO: note that stty.c needs this small clean-up.
+
2007-03-13 Jim Meyering <jim@meyering.net>
Prepare to work on ACL-related failure when using Solaris ZFS.
diff --git a/Makefile.maint b/Makefile.maint
index c1da0d559..1c9d69712 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -117,12 +117,12 @@ sc_space_tab:
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
1>&2; exit 1; } || :
-# Don't use the old ato* functions in `real' code.
+# Don't use *scanf or the old ato* functions in `real' code.
# They provide no error checking mechanism.
# Instead, use strto* functions.
sc_prohibit_atoi_atof:
- @grep -nE '\<ato([filq]|ll)\>' $$($(CVS_LIST_EXCEPT)) && \
- { echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
+ @grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(CVS_LIST_EXCEPT)) && \
+ { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, or ato''q' \
1>&2; exit 1; } || :
# Using EXIT_SUCCESS as the first argument to error is misleading,
diff --git a/TODO b/TODO
index 61fe29c36..0e626306a 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,6 @@
+stty.c:
+ use xstrtoul, not sscanf
+
printf:
Now that gnulib supports *printf("%a"), import one of the
*printf-posix modules so that printf(1) will support %a even on