Module Name: src Committed By: rillig Date: Tue Jun 29 13:48:24 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: clean up lex_character_constant No functional change. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.47 src/usr.bin/xlint/lint1/lex.c:1.48 --- src/usr.bin/xlint/lint1/lex.c:1.47 Tue Jun 29 07:23:21 2021 +++ src/usr.bin/xlint/lint1/lex.c Tue Jun 29 13:48:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.47 2021/06/29 07:23:21 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.48 2021/06/29 13:48:24 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.47 2021/06/29 07:23:21 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.48 2021/06/29 13:48:24 rillig Exp $"); #endif #include <ctype.h> @@ -820,7 +820,6 @@ lex_character_constant(void) { size_t n; int val, c; - char cv; n = 0; val = 0; @@ -844,8 +843,12 @@ lex_character_constant(void) error(73); } if (n == 1) { - cv = (char)val; - val = cv; + /* + * XXX: use the target platform's 'char' instead of the + * 'char' from the execution environment, to be able to + * run lint for powerpc on x86_64. + */ + val = (char)val; } yylval.y_val = xcalloc(1, sizeof(*yylval.y_val));