Project

General

Profile

Actions

Bug #14488

closed

lex: clean up warnings

Added by Toomas Soome 8 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Due to yacc code specifics, we need to keep -Wno-unused-label

Add missing parentheses, convert while expressions to boolean, and fix signed versus unsigned compare.

Testing done: build/install/boot

wsdiff does not report any differences for sub1.o and sub2.o, sub3.o:

/code/14488/usr/src/cmd/sgs/lex/i386/objs/sub3.o
NOTE: ELF .text difference detected.

27c27
<     setsymbol+0x10: 7f 0c              jg     +0xc    <setsymbol+0x1e>
---
>     setsymbol+0x10: 77 0c              ja     +0xc    <setsymbol+0x1e>

I did compare scanner.c built in tools/cscope-fast:

$ /usr/ccs/bin/lex -t scanner.l > scanner.c
571/1000 nodes(%e), 2961/3000 positions(%p), 212/500 (%n), 14424 transitions,
375/10000 packed char classes(%k), 2486/6000 packed transitions(%a), 3541/11000 output slots(%o)

$ /code/illumos-gate/usr/src/cmd/sgs/lex/i386/lex -t scanner.l > scanner.c
571/1000 nodes(%e), 2961/3000 positions(%p), 212/500 (%n), 14424 transitions,
375/10000 packed char classes(%k), 2486/6000 packed transitions(%a), 3541/11000 output slots(%o)

(here my build host is already updated to use patched lex)

and

tsoome@beastie:/code/illumos-gate/usr/src/tools/cscope-fast$ diff -u scanner.c /code/14488/usr/src/tools/cscope-fast/scanner.c
No differences encountered

The generated C source is identical.

Actions #1

Updated by Electric Monk 8 months ago

  • Gerrit CR set to 2012
Actions #2

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
Actions #3

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
Actions #4

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 55855f50d61b53851853bf1fdcdb04d4b63a1734

commit  55855f50d61b53851853bf1fdcdb04d4b63a1734
Author: Toomas Soome <tsoome@me.com>
Date:   2022-02-17T19:40:28.000Z

    14488 lex: clean up warnings
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF