Skip to content

Commit

Permalink
mark packages that fail with -Werror=char-subscripts
Browse files Browse the repository at this point in the history
These packages are susceptible to bugs when confronted with non-ASCII
characters.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182.

It takes some time to analyze and fix these individually, therefore they
are only marked as "needs work".
  • Loading branch information
rillig committed May 20, 2020
1 parent 4691f2b commit 3f9812b
Show file tree
Hide file tree
Showing 52 changed files with 403 additions and 52 deletions.
9 changes: 8 additions & 1 deletion audio/goom/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 2020/01/26 17:30:42 rillig Exp $
# $NetBSD: Makefile,v 1.13 2020/05/20 06:09:04 rillig Exp $

DISTNAME= goom-2k4-0-src
PKGNAME= goom-2004.0
Expand All @@ -18,5 +18,12 @@ GNU_CONFIGURE= yes
GCC_REQD+= 3.3
USE_TOOLS+= pkg-config

# convolve_fx.c: In function 'create_output_with_brightness':
# convolve_fx.c:222:20: error: array subscript has type 'char' [-Werror=char-subscripts]
# iff2 = ifftab[data->conv_motif[(ytex >>16) & CONV_MOTIF_WMASK][(xtex >> 16) & CONV_MOTIF_WMASK]];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
12 changes: 11 additions & 1 deletion audio/mpegaudio/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2015/12/29 04:54:35 dholland Exp $
# $NetBSD: Makefile,v 1.10 2020/05/20 06:09:06 rillig Exp $

DISTNAME= mpegaudio
PKGNAME= mpegaudio-3.9
Expand All @@ -11,6 +11,16 @@ COMMENT= MPEG/audio Layer 1 and Layer 2 encoder/decoder package

INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1

# common.c: In function 'aiff_read_headers':
# common.c:729:28: error: array subscript has type 'char' [-Werror=char-subscripts]
# temp_sampleRate[i] = CommChunk.sampleRate[i];
# ^
# common.c:729:54: error: array subscript has type 'char' [-Werror=char-subscripts]
# temp_sampleRate[i] = CommChunk.sampleRate[i];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

post-install:
${INSTALL_MAN} ${FILESDIR}/mpeg_musicin.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
${INSTALL_MAN} ${FILESDIR}/mpeg_musicout.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
Expand Down
9 changes: 8 additions & 1 deletion biology/lucy/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.11 2020/01/26 05:26:15 rillig Exp $
# $NetBSD: Makefile,v 1.12 2020/05/20 06:09:06 rillig Exp $
#

DISTNAME= ${PKGNAME:S/-//}
Expand All @@ -16,6 +16,13 @@ WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}p
AUTO_MKDIRS= yes
PTHREAD_AUTO_VARS= yes

# abi.c: In function 'abi_align':
# abi.c:195:16: error: array subscript has type 'char' [-Werror=char-subscripts]
# if (badness[a[i]][b[j]]) {
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/lucy ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/lucy.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
Expand Down
9 changes: 8 additions & 1 deletion cad/fasthenry/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.31 2020/01/26 17:30:47 rillig Exp $
# $NetBSD: Makefile,v 1.32 2020/05/20 06:09:03 rillig Exp $
#

DISTNAME= fasthenry-3.0-12Nov96
Expand Down Expand Up @@ -36,6 +36,13 @@ MAKE_ENV+= LIBS=${LIBS:M*:Q}
GCC_REQD+= 2.95.3
.endif

# contact.c: In function 'walk_along_edge':
# contact.c:1334:40: error: array subscript has type 'char' [-Werror=char-subscripts]
# equiv_nodes_on_edge(cell->bndry.nodes[start_node], travel_dir,
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

INSTALLATION_DIRS= bin

.include "../../mk/bsd.pkg.mk"
8 changes: 7 additions & 1 deletion cad/magic/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.35 2019/06/08 11:04:29 rillig Exp $
# $NetBSD: Makefile,v 1.36 2020/05/20 06:09:06 rillig Exp $
#

DISTNAME= magic-7.5.188
Expand Down Expand Up @@ -34,6 +34,12 @@ CPPFLAGS+= -DIS_BIG_ENDIAN
CPPFLAGS+= -DIS_LITTLE_ENDIAN
.endif

# DBundo.c: In function 'dbUndoPaintForw':
# DBundo.c:268:42: error: array subscript has type 'char' [-Werror=char-subscripts]
# DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

USE_TOOLS+= awk:run
REPLACE_INTERPRETER+= awk
REPLACE.awk.old= /bin/awk
Expand Down
8 changes: 7 additions & 1 deletion cad/spice/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.48 2019/06/08 11:04:30 rillig Exp $
# $NetBSD: Makefile,v 1.49 2020/05/20 06:09:08 rillig Exp $

DISTNAME= sp3f4.kit
PKGNAME= spice-3f5.1
Expand Down Expand Up @@ -42,6 +42,12 @@ SUBST_STAGE.conf= pre-configure
SUBST_FILES.conf= conf/NetBSD conf/defaults
SUBST_VARS.conf= MAKE_PROGRAM CFLAGS LDFLAGS WRKSRC PREFIX X11BASE

# src/lib/cp//modify.c: In function 'cp_init':
# src/lib/cp//modify.c:26:17: error: array subscript has type 'char' [-Werror=char-subscripts]
# cp_chars[*s] = (CPC_BRR | CPC_BRL);
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

do-configure:
rm -f ${WRKSRC}/makefile

Expand Down
11 changes: 10 additions & 1 deletion cad/veriwell/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2020/03/18 17:45:25 joerg Exp $
# $NetBSD: Makefile,v 1.3 2020/05/20 06:09:09 rillig Exp $

DISTNAME= veriwell-2.8.7
CATEGORIES= cad
Expand All @@ -14,5 +14,14 @@ USE_LANGUAGES= c c++03

TEST_TARGET= check

# parse.yy:2253:57: error: array subscript has type 'char' [-Werror=char-subscripts]
# parse.yy:2253:85: error: array subscript has type 'char' [-Werror=char-subscripts]
# $$ = edge_mask[$1[0]][$1[1]];
# parse.yy:2258:79: error: array subscript has type 'char' [-Werror=char-subscripts]
# parse.yy:2258:108: error: array subscript has type 'char' [-Werror=char-subscripts]
# $$ = $3 | edge_mask[$1[0]][$1[1]];
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
9 changes: 8 additions & 1 deletion comms/estic/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.38 2019/11/03 12:04:12 rillig Exp $
# $NetBSD: Makefile,v 1.39 2020/05/20 06:09:03 rillig Exp $

DISTNAME= estic-1.61
PKGREVISION= 2
Expand Down Expand Up @@ -32,6 +32,13 @@ CPPFLAGS+= -DSOLARIS
CPPFLAGS+= -DFREEBSD
.endif

# str.cc: In function 'String ShowControls(const String&, unsigned int)':
# str.cc:1145:57: error: array subscript has type 'char' [-Werror=char-subscripts]
# T += (Style & ccOct)? OctCodes [*Str] : HexCodes [*Str];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

INSTALLATION_DIRS= bin

post-extract:
Expand Down
9 changes: 8 additions & 1 deletion comms/gsmlib/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.27 2018/07/18 00:06:12 joerg Exp $
# $NetBSD: Makefile,v 1.28 2020/05/20 06:09:04 rillig Exp $
#

DISTNAME= gsmlib-1.10
Expand All @@ -19,6 +19,13 @@ CONFIGURE_ARGS+= --without-included-gettext
PTHREAD_OPTS+= require
PTHREAD_AUTO_VARS= yes

# gsm_util.cc: In function 'std::string gsmlib::gsmToLatin1(std::string)':
# gsm_util.cc:107:72: error: array subscript has type 'char' [-Werror=char-subscripts]
# result[i] = (unsigned char)s[i] > 127 ? NOP : gsmToLatin1Table[s[i]];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
10 changes: 9 additions & 1 deletion devel/gcvs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.45 2020/01/26 05:26:23 rillig Exp $
# $NetBSD: Makefile,v 1.46 2020/05/20 06:09:04 rillig Exp $

DISTNAME= gcvs-1.0
PKGREVISION= 14
Expand All @@ -24,6 +24,14 @@ CONFIGURE_ARGS+= perl_path=${PERL5}

CPPFLAGS+= -DUSE_INTERP_RESULT

# Uh oh, Pascal-style strings with undefined behavior for length >= 128.
# ../rf/ustr.h: In member function 'bool UPStr::endsWith(char) const':
# ../rf/ustr.h:96:75: error: array subscript has type 'char' [-Werror=char-subscripts]
# inline bool endsWith(char c) const {return str == 0L ? false : str[str[0]] == c;}
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../lang/tcl/buildlink3.mk"
.include "../../x11/gtk/buildlink3.mk"

Expand Down
8 changes: 7 additions & 1 deletion devel/mcpp/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2017/09/03 08:53:07 wiz Exp $
# $NetBSD: Makefile,v 1.3 2020/05/20 06:09:06 rillig Exp $

DISTNAME= mcpp-2.7.2
CATEGORIES= devel
Expand All @@ -15,4 +15,10 @@ USE_LIBTOOL= yes

CONFIGURE_ARGS+= --enable-mcpplib

# eval.c: In function 'eval_if':
# eval.c:361:44: error: array subscript has type 'char' [-Werror=char-subscripts]
# , opname[ op], prec, opname[ opp->op], opp->prec, opp->skip);
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/bsd.pkg.mk"
12 changes: 11 additions & 1 deletion devel/prcs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.60 2020/03/20 11:57:30 nia Exp $
# $NetBSD: Makefile,v 1.61 2020/05/20 06:09:07 rillig Exp $

DISTNAME= prcs-1.3.3
PKGREVISION= 14
Expand Down Expand Up @@ -28,4 +28,14 @@ REPLACE.perl5.old= .*perl[^[:space:]]*
REPLACE.perl5.new= ${PERL5}
REPLACE_FILES.perl5= emacs/prcs-ediff emacs/prcs-emerge

# attrs.cc: In function 'int is_file_attribute_hash(const char*, int)':
# attrs.cc:36:39: error: array subscript has type 'char' [-Werror=char-subscripts]
# return len + hash_table[str[len - 1]] + hash_table[str[0]];
# ^
# attrs.cc:36:60: error: array subscript has type 'char' [-Werror=char-subscripts]
# return len + hash_table[str[len - 1]] + hash_table[str[0]];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/bsd.pkg.mk"
8 changes: 7 additions & 1 deletion devel/sdcc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.57 2020/03/20 11:57:32 nia Exp $
# $NetBSD: Makefile,v 1.58 2020/05/20 06:09:08 rillig Exp $

DISTNAME= sdcc-src-2.8.0
PKGNAME= ${DISTNAME:S/-src//}
Expand Down Expand Up @@ -38,6 +38,12 @@ CPPFLAGS+= -fdollars-in-identifiers
CONFIGURE_ENV+= MACHINE_ARCH=${MACHINE_ARCH:Q}
CONFIGURE_ENV+= sdcc_cv_CCggdb="no"

# simi.c: In function 'simGetValue':
# simi.c:616:14: error: array subscript has type 'char' [-Werror=char-subscripts]
# b[i] = strtol(resp,&resp,16);
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "NetBSD"
Expand Down
8 changes: 7 additions & 1 deletion devel/sgb/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2020/01/29 16:04:04 minskim Exp $
# $NetBSD: Makefile,v 1.10 2020/05/20 06:09:08 rillig Exp $

DISTNAME= sgb-2007-03.28
PKGNAME= sgb-20070328
Expand Down Expand Up @@ -27,6 +27,12 @@ SUBST_FILES.paths= Makefile
SUBST_VARS.paths= LOCALBASE
SUBST_SED.paths+= -e 's,@PREFIX@,$${DESTDIR}${PREFIX},g'

# gb_io.w: In function 'icode_setup':
# gb_io.w:217:34: error: array subscript has type 'char' [-Werror=char-subscripts]
# for (p=imap,k=0; *p; p++,k++) icode[*p]=k;
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

post-install:
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/sgb
.for f in abstract.dvi README ERRATA
Expand Down
9 changes: 8 additions & 1 deletion devel/tvision/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.25 2018/07/18 00:06:13 joerg Exp $
# $NetBSD: Makefile,v 1.26 2020/05/20 06:09:09 rillig Exp $
#

DISTNAME= tvision-0.8
Expand All @@ -18,5 +18,12 @@ GNU_CONFIGURE= YES
USE_LANGUAGES= c c++03
USE_LIBTOOL= YES

# puzzle.cc: In member function 'virtual void TPuzzleView::draw()':
# puzzle.cc:134:75: error: array subscript has type 'char' [-Werror=char-subscripts]
# buf.moveStr( (short)(j*3), tmp, color[map[board[i][j]-'A']]);
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
9 changes: 8 additions & 1 deletion editors/em/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2017/12/24 09:46:05 wiz Exp $
# $NetBSD: Makefile,v 1.3 2020/05/20 06:09:03 rillig Exp $

DISTNAME= em-1.0.0
CATEGORIES= editors
Expand All @@ -12,4 +12,11 @@ LICENSE= public-domain
GNU_CONFIGURE= yes
AUTO_MKDIRS= yes

# em1.c: In function 'advance':
# em1.c:1554:11: error: array subscript has type 'char' [-Werror=char-subscripts]
# braslist[*ep++] = lp;
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/bsd.pkg.mk"
9 changes: 8 additions & 1 deletion editors/emacs20/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.61 2020/01/26 17:31:06 rillig Exp $
# $NetBSD: Makefile,v 1.62 2020/05/20 06:09:03 rillig Exp $

DISTNAME= emacs-20.7
PKGNAME= ${DISTNAME:S/emacs/emacs20/}
Expand Down Expand Up @@ -84,6 +84,13 @@ MAKEFILECPP= ${CPP} -traditional-cpp
.endif
ALL_ENV+= MAKEFILECPP=${MAKEFILECPP:Q}

# emacs-20.7/lib-src/etags.c: In function 'init':
# emacs-20.7/lib-src/etags.c:1208:35: error: array subscript has type 'char' [-Werror=char-subscripts]
# for (sp = white; *sp; sp++) _wht[*sp] = TRUE; _wht[0] = _wht['\n'];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

INFO_FILES= yes

INSTALL_PROGRAM= ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
Expand Down
8 changes: 7 additions & 1 deletion editors/se/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2015/08/18 07:31:06 wiz Exp $
# $NetBSD: Makefile,v 1.5 2020/05/20 06:09:08 rillig Exp $

DISTNAME= se-3.0.1
PKGREVISION= 1
Expand All @@ -12,5 +12,11 @@ LICENSE= public-domain

GNU_CONFIGURE= yes

# pat.c: In function 'amatch':
# pat.c:101:10: error: array subscript has type 'char' [-Werror=char-subscripts]
# tagbeg[*(ppat + 1)] = lastc - lin;
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
9 changes: 8 additions & 1 deletion filesystems/fuse-afpfs-ng/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.15 2019/06/22 11:52:31 nia Exp $
# $NetBSD: Makefile,v 1.16 2020/05/20 06:09:04 rillig Exp $

DISTNAME= afpfs-ng-0.8.1
PKGNAME= fuse-${DISTNAME}
Expand Down Expand Up @@ -29,6 +29,13 @@ SUBST_SED.termcap+= -e 's|ncurses||'
SUBST_SED.termcap+= -e 's|ncurses|${BUILDLINK_LIBNAME.termcap}|'
.endif

# debug.c: In function 'afp_get_command_name':
# debug.c:62:33: error: array subscript has type 'char' [-Werror=char-subscripts]
# return afp_command_names[code];
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

.include "../../devel/gmp/buildlink3.mk"
.include "../../security/libgpg-error/buildlink3.mk"
.include "../../security/libgcrypt/buildlink3.mk"
Expand Down
9 changes: 8 additions & 1 deletion games/devilutionx/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 2020/03/30 19:36:39 joerg Exp $
# $NetBSD: Makefile,v 1.13 2020/05/20 06:09:03 rillig Exp $

DISTNAME= devilutionx-1.0.1
CATEGORIES= games
Expand Down Expand Up @@ -37,6 +37,13 @@ CXXFLAGS+= -DO_LARGEFILE=0 -Dstat64=stat -Dlstat64=lstat -Dlseek64=lseek -Doff64
# No idea.
CXXFLAGS.NetBSD+= -D_NETBSD_SOURCE

# 3rdParty/StormLib/src/SFileFindFile.cpp: In function 'int CheckWildCard(const char*, const char*)':
# 3rdParty/StormLib/src/SFileFindFile.cpp:72:54: error: array subscript has type 'char' [-Werror=char-subscripts]
# if(AsciiToUpperTable[szWildCardPtr[0]] == AsciiToUpperTable[szString[0]])
# ^
# Maybe fix this later.
BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts

INSTALLATION_DIRS+= bin
INSTALLATION_DIRS+= share/applications
INSTALLATION_DIRS+= share/icons/hicolor/16x16/apps
Expand Down
Loading

0 comments on commit 3f9812b

Please sign in to comment.