bug-gnu-utils
[Top][All Lists]
Advanced

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

gawk 3.1.1n problems reported by Sun WorkShop 6 update 2 C 5.3


From: Paul Eggert
Subject: gawk 3.1.1n problems reported by Sun WorkShop 6 update 2 C 5.3
Date: Mon, 10 Mar 2003 13:20:59 -0800 (PST)

I built gawk 3.1.1n on Solaris 7 sparc with Sun WorkShop 6 update 2 C
5.3 in 64-bit mode (configured with "CFLAGS='cc -xarch=v9'
configure"), and it reported the following diagnostics.

cc -xarch=v9 -DDEFPATH="\".:/usr/local/share/awk\"" -DHAVE_CONFIG_H -DGAWK 
-DLOCALEDIR="\"/usr/local/share/locale\"" -I. -I../gawk-3.1.1n -I. 
-I../gawk-3.1.1n/intl    -g -c `test -f '../gawk-3.1.1n/io.c' || echo 
'../gawk-3.1.1n/'`../gawk-3.1.1n/io.c
"../gawk-3.1.1n/io.c", line 2895: warning: statement not reached

cc -xarch=v9 -DDEFPATH="\".:/usr/local/share/awk\"" -DHAVE_CONFIG_H -DGAWK 
-DLOCALEDIR="\"/usr/local/share/locale\"" -I. -I../gawk-3.1.1n -I. 
-I../gawk-3.1.1n/intl    -g -c `test -f '../gawk-3.1.1n/regex.c' || echo 
'../gawk-3.1.1n/'`../gawk-3.1.1n/regex.c
"/usr/include/limits.h", line 175: warning: macro redefined: RE_DUP_MAX
"../gawk-3.1.1n/regcomp.c", line 3358: warning: integer overflow detected: op 
"<<"

All the diagnostics seem to be relevant.

First, io.c contains some unused (the <rsnull end loop logic>).  This
is not a bug in and of itself, but it indicates that there might be a
bug nearby.

Second, regex.c includes regex_internal.h, (which includes the system
limits.h, which defines RE_DUP_MAX) before including <regex.h>,
causing the RE_DUP_MAX problem.  The system RE_DUP_MAX is 255, which
will cause gawk to have an arbitrary limit of 255 repetitions, even
though internally it can support 32767 repetitions.  Here is an
example shell transcript that illustrates the bug:

$ gawk --posix '/f{256}/'
gawk: cmd. line:1: fatal: Invalid content of \{\}: /f{256}/

Third, regcomp.c computes 1 << 31, which has undefined behavior due to
overflow; it should compute ((unsigned int) 1 << 31) instead.  This is
not a bug on this particular platform, but I suppose it might be a bug
on other platforms.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]