summaryrefslogtreecommitdiff
path: root/usr.bin/xlint
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2011-07-03 18:15:11 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2011-07-03 18:15:11 +0000
commite76c0d219d76343b61728f7e74319328e74fa975 (patch)
tree6bbab8615a121f1c6f751b6ba74da4e1d6f5cd1c /usr.bin/xlint
parentd760db0391c019cfefa3dbcfb54d438a8ba88d0d (diff)
Update floating-point format specifier checks; the situation has
gotten better. %E, %F, %G are OK to use. Also recognize %a, %A.
Diffstat (limited to 'usr.bin/xlint')
-rw-r--r--usr.bin/xlint/lint2/chk.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/usr.bin/xlint/lint2/chk.c b/usr.bin/xlint/lint2/chk.c
index 0ceb418d271..7996ad33596 100644
--- a/usr.bin/xlint/lint2/chk.c
+++ b/usr.bin/xlint/lint2/chk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chk.c,v 1.24 2011/06/20 13:33:47 martynas Exp $ */
+/* $OpenBSD: chk.c,v 1.25 2011/07/03 18:15:10 martynas Exp $ */
/* $NetBSD: chk.c,v 1.2 1995/07/03 21:24:42 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: chk.c,v 1.24 2011/06/20 13:33:47 martynas Exp $";
+static char rcsid[] = "$OpenBSD: chk.c,v 1.25 2011/07/03 18:15:10 martynas Exp $";
#endif
#include <stdlib.h>
@@ -1034,29 +1034,10 @@ scanflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
badfmt(hte, call);
sz = ULONG;
goto conv;
- } else if (fc == 'E') {
- /*
- * XXX valid in ANSI C, but in NetBSD's libc imple-
- * mented as "lf". Thats why it should be avoided.
- */
- badfmt(hte, call);
- sz = DOUBLE;
- goto conv;
- } else if (fc == 'F') {
- /* XXX only for backward compatibility */
- badfmt(hte, call);
- sz = DOUBLE;
- goto conv;
- } else if (fc == 'G') {
- /*
- * XXX valid in ANSI C, but in NetBSD's libc not
- * implemented
- */
- if (sz != NOTSPEC && sz != LONG && sz != LDOUBLE)
- badfmt(hte, call);
- goto fconv;
- } else if (fc == 'e' || fc == 'f' || fc == 'g') {
- fconv:
+ } else if (fc == 'e' || fc == 'E' ||
+ fc == 'f' || fc == 'F' ||
+ fc == 'g' || fc == 'G' ||
+ fc == 'a' || fc == 'A') {
if (sz == NOTSPEC) {
sz = FLOAT;
} else if (sz == LONG) {