Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: remove dead code from lex_floating...



details:   https://anonhg.NetBSD.org/src/rev/7b66a23b7c0b
branches:  trunk
changeset: 373577:7b66a23b7c0b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Feb 18 15:09:10 2023 +0000

description:
lint: remove dead code from lex_floating_constant

Neither traditional C nor C11 allows a trailing 'd' or 'D' on floating
point constants. Java does, but lint does not cover Java programs.

diffstat:

 usr.bin/xlint/lint1/lex.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 066021a0d0b8 -r 7b66a23b7c0b usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Sat Feb 18 15:05:38 2023 +0000
+++ b/usr.bin/xlint/lint1/lex.c Sat Feb 18 15:09:10 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.151 2023/02/18 15:05:38 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.152 2023/02/18 15:09:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.151 2023/02/18 15:05:38 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.152 2023/02/18 15:09:10 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -639,11 +639,8 @@
        } else if (c == 'l' || c == 'L') {
                typ = LDOUBLE;
                len--;
-       } else {
-               if (c == 'd' || c == 'D')
-                       len--;
+       } else
                typ = DOUBLE;
-       }
 
        if (!allow_c90 && typ != DOUBLE) {
                /* suffixes F and L are illegal in traditional C */



Home | Main Index | Thread Index | Old Index