(sc_prohibit_atoi_atof): New rule.
authorJim Meyering <jim@meyering.net>
Tue, 30 Mar 2004 15:11:24 +0000 (15:11 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 30 Mar 2004 15:11:24 +0000 (15:11 +0000)
(syntax-check-rules): Add it.

Makefile.maint

index af9b26f..77b5160 100644 (file)
@@ -74,6 +74,7 @@ syntax-check-rules = \
   sc_cast_of_alloca_return_value \
   sc_changelog \
   sc_error_exit_success \
+  sc_prohibit_atoi_atof \
   sc_space_tab \
   sc_sun_os_names \
   sc_system_h_headers \
@@ -125,6 +126,13 @@ sc_space_tab:
          { echo '$(ME): found SPACE-TAB sequence; remove the SPACE'    \
                1>&2; exit 1; } || :
 
+sc_prohibit_atoi_atof:
+       @( cvsu --list ) > /dev/null 2>&1 || : &&                       \
+         grep '\<ato[fil]\>'                                           \
+            $$(cvsu --list | grep -vEf .x-$@ ) &&                      \
+         { echo '$(ME): do not use atof, atoi, or atol'                \
+               1>&2; exit 1; } || :
+
 # Using EXIT_SUCCESS as the first argument to error is misleading,
 # since when that parameter is 0, error does not exit.  Use `0' instead.
 sc_error_exit_success: